About the project

At first overwhelming for non experienced programmers or advanced users in the computer field. Nonetheless, after a few hours of careful reading instructions and many self learning sessions in the provided tools one can start to understand that sky is the limit for the stubborn and motivated individuals.

This course will allow you to master R language and give you insights in the possible ways you can use it to analyse different kinds of data.

1 Tools and methods for open and reproducible research

This chapter allows you to learn how to use the course Softwares (RStudio & GitHub desktop & GitHub) and get the first contact with some of the basic RMarkdown codes

1.1 Work done during the week and learning summary.

  • Completed the following courses on DataCamp:
    • “R short and sweet” ;

    • “Introduction to R” (Extra ; highly recommend the daily exercises after finishing up this course, perfect and quick way to remind little things you learn till this moment);

    • “DataCamp (EXTRA): Helsinki Social Statistics” (Similar to the mandatory “R short and Sweet” but nothing like practicing to solidify the learn code, fucntions, etc.. )

    • 1st free chapters of “Intermediate R”" ; “Cleaning Data in R” & “Data manipulation in R With dplyr” (Extra ; gave a clear idea on how complex this can become and once again good practice/reminder of basics learnt till now)

  • Installed RStudio, GitHub desktop, and explored the RMarkdown Basics & R Code Chunks provided help lists.

    • Edited my profile picture and explored GitHub settings (Extra)

    • Succesfully forked the IODS project to personal repository & found my own repository and course diary link

    • Created the new file RMarkdown (README.Rmd)

    • Altered the team of the course diary in online GitHub (Extra)

    • Commited to my branch of the master repostiory my intermediate and final changes

    • Started working in the chapter2.Rmd by accident but sucessfully hide it from the 1st peer-review deadline

    • Managed to fix an error message in RStudio start up (Mac OS El Capitan version incompatibility)


2 Regression and model validation

During this chapter the amount of information to be memorized is higher and more complex. The datacamp exercise, including the videos included in it touch the surface of what you can do to build graphs to visualize and analyse your data. Note that during this chapter you will definetily need to consult external help cheats (mostly provided during the datacamp and your mooc links)

2.1 1. Data wrangling exercise

Load the data set provided (questionary answers regarding learning approaches and students accomplishments in a statistics course):

  • All data provided in the url
#read the data from URL provided link
lrn14 <- read.table("http://www.helsinki.fi/~kvehkala/JYTmooc/JYTOPKYS3-data.txt", sep="\t", header=TRUE)

Data after data wrangling exercises (stored locally)

#read the data from file located in your hard drive
learning2014 <- read.csv("learning2014.csv")
  • Questions related to the following topics were placed together:
    - deep_questions , surface_questions , strategic_questions
  1. How to extract information from data

Since the full data set can be overwelming to explore, viewing the structure, summary and the first values of the data can be helpful to identify what are your main interests in this questionary answers.

#view the structure and summary of the non filtered "learning2014" data
str(lrn14)
## 'data.frame':    183 obs. of  60 variables:
##  $ Aa      : int  3 2 4 4 3 4 4 3 2 3 ...
##  $ Ab      : int  1 2 1 2 2 2 1 1 1 2 ...
##  $ Ac      : int  2 2 1 3 2 1 2 2 2 1 ...
##  $ Ad      : int  1 2 1 2 1 1 2 1 1 1 ...
##  $ Ae      : int  1 1 1 1 2 1 1 1 1 1 ...
##  $ Af      : int  1 1 1 1 1 1 1 1 1 2 ...
##  $ ST01    : int  4 4 3 3 4 4 5 4 4 4 ...
##  $ SU02    : int  2 2 1 3 2 3 2 2 1 2 ...
##  $ D03     : int  4 4 4 4 5 5 4 4 5 4 ...
##  $ ST04    : int  4 4 4 4 3 4 2 5 5 4 ...
##  $ SU05    : int  2 4 2 3 4 3 2 4 2 4 ...
##  $ D06     : int  4 2 3 4 4 5 3 3 4 4 ...
##  $ D07     : int  4 3 4 4 4 5 4 4 5 4 ...
##  $ SU08    : int  3 4 1 2 3 4 4 2 4 2 ...
##  $ ST09    : int  3 4 3 3 4 4 2 4 4 4 ...
##  $ SU10    : int  2 1 1 1 2 1 1 2 1 2 ...
##  $ D11     : int  3 4 4 3 4 5 5 3 4 4 ...
##  $ ST12    : int  3 1 4 3 2 3 2 4 4 4 ...
##  $ SU13    : int  3 3 2 2 3 1 1 2 1 2 ...
##  $ D14     : int  4 2 4 4 4 5 5 4 4 4 ...
##  $ D15     : int  3 3 2 3 3 4 2 2 3 4 ...
##  $ SU16    : int  2 4 3 2 3 2 3 3 4 4 ...
##  $ ST17    : int  3 4 3 3 4 3 4 3 4 4 ...
##  $ SU18    : int  2 2 1 1 1 2 1 2 1 2 ...
##  $ D19     : int  4 3 4 3 4 4 4 4 5 4 ...
##  $ ST20    : int  2 1 3 3 3 3 1 4 4 2 ...
##  $ SU21    : int  3 2 2 3 2 4 1 3 2 4 ...
##  $ D22     : int  3 2 4 3 3 5 4 2 4 4 ...
##  $ D23     : int  2 3 3 3 3 4 3 2 4 4 ...
##  $ SU24    : int  2 4 3 2 4 2 2 4 2 4 ...
##  $ ST25    : int  4 2 4 3 4 4 1 4 4 4 ...
##  $ SU26    : int  4 4 4 2 3 2 1 4 4 4 ...
##  $ D27     : int  4 2 3 3 3 5 4 4 5 4 ...
##  $ ST28    : int  4 2 5 3 5 4 1 4 5 2 ...
##  $ SU29    : int  3 3 2 3 3 2 1 2 1 2 ...
##  $ D30     : int  4 3 4 4 3 5 4 3 4 4 ...
##  $ D31     : int  4 4 3 4 4 5 4 4 5 4 ...
##  $ SU32    : int  3 5 5 3 4 3 4 4 3 4 ...
##  $ Ca      : int  2 4 3 3 2 3 4 2 3 2 ...
##  $ Cb      : int  4 4 5 4 4 5 5 4 5 4 ...
##  $ Cc      : int  3 4 4 4 4 4 4 4 4 4 ...
##  $ Cd      : int  4 5 4 4 3 4 4 5 5 5 ...
##  $ Ce      : int  3 5 3 3 3 3 4 3 3 4 ...
##  $ Cf      : int  2 3 4 4 3 4 5 3 3 4 ...
##  $ Cg      : int  3 2 4 4 4 5 5 3 5 4 ...
##  $ Ch      : int  4 4 2 3 4 4 3 3 5 4 ...
##  $ Da      : int  3 4 1 2 3 3 2 2 4 1 ...
##  $ Db      : int  4 3 4 4 4 5 4 4 2 4 ...
##  $ Dc      : int  4 3 4 5 4 4 4 4 4 4 ...
##  $ Dd      : int  5 4 1 2 4 4 5 3 5 2 ...
##  $ De      : int  4 3 4 5 4 4 5 4 4 2 ...
##  $ Df      : int  2 2 1 1 2 3 1 1 4 1 ...
##  $ Dg      : int  4 3 3 5 5 4 4 4 5 1 ...
##  $ Dh      : int  3 3 1 4 5 3 4 1 4 1 ...
##  $ Di      : int  4 2 1 2 3 3 2 1 4 1 ...
##  $ Dj      : int  4 4 5 5 3 5 4 5 2 4 ...
##  $ Age     : int  53 55 49 53 49 38 50 37 37 42 ...
##  $ Attitude: int  37 31 25 35 37 38 35 29 38 21 ...
##  $ Points  : int  25 12 24 10 22 21 21 31 24 26 ...
##  $ gender  : Factor w/ 2 levels "F","M": 1 2 1 2 2 1 2 1 2 1 ...
summary(lrn14)
##        Aa             Ab              Ac              Ad       
##  Min.   :1.00   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.00   1st Qu.:1.000   1st Qu.:1.000   1st Qu.:1.000  
##  Median :3.00   Median :2.000   Median :2.000   Median :1.000  
##  Mean   :3.06   Mean   :1.787   Mean   :2.077   Mean   :1.617  
##  3rd Qu.:4.00   3rd Qu.:2.000   3rd Qu.:2.000   3rd Qu.:2.000  
##  Max.   :5.00   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##        Ae              Af             ST01            SU02      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:1.000   1st Qu.:1.000   1st Qu.:3.000   1st Qu.:2.000  
##  Median :1.000   Median :1.000   Median :4.000   Median :2.000  
##  Mean   :1.437   Mean   :1.579   Mean   :3.765   Mean   :2.612  
##  3rd Qu.:1.000   3rd Qu.:2.000   3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D03             ST04            SU05            D06       
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000  
##  Median :4.000   Median :3.000   Median :3.000   Median :4.000  
##  Mean   :4.361   Mean   :3.213   Mean   :2.874   Mean   :3.448  
##  3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D07            SU08            ST09            SU10      
##  Min.   :1.00   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.00   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:1.000  
##  Median :4.00   Median :2.000   Median :4.000   Median :2.000  
##  Mean   :3.94   Mean   :2.508   Mean   :3.224   Mean   :1.995  
##  3rd Qu.:5.00   3rd Qu.:3.500   3rd Qu.:4.000   3rd Qu.:2.000  
##  Max.   :5.00   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D11             ST12            SU13            D14       
##  Min.   :2.000   Min.   :1.000   Min.   :1.000   Min.   :2.000  
##  1st Qu.:4.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:4.000  
##  Median :4.000   Median :3.000   Median :2.000   Median :4.000  
##  Mean   :3.934   Mean   :2.923   Mean   :2.546   Mean   :4.087  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:3.000   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D15             SU16            ST17           SU18      
##  Min.   :1.000   Min.   :1.000   Min.   :1.00   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.00   1st Qu.:1.000  
##  Median :3.000   Median :3.000   Median :3.00   Median :1.000  
##  Mean   :3.224   Mean   :2.814   Mean   :3.18   Mean   :1.902  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.00   3rd Qu.:2.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.00   Max.   :5.000  
##       D19            ST20            SU21            D22       
##  Min.   :1.00   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.00   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000  
##  Median :4.00   Median :2.000   Median :2.000   Median :3.000  
##  Mean   :3.71   Mean   :2.563   Mean   :2.546   Mean   :3.344  
##  3rd Qu.:4.00   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :5.00   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D23             SU24            ST25            SU26      
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:4.000  
##  Median :3.000   Median :3.000   Median :4.000   Median :4.000  
##  Mean   :3.137   Mean   :3.055   Mean   :3.339   Mean   :4.126  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       D27             ST28            SU29           D30       
##  Min.   :1.000   Min.   :1.000   Min.   :1.00   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:1.000   1st Qu.:2.00   1st Qu.:3.000  
##  Median :4.000   Median :2.000   Median :2.00   Median :4.000  
##  Mean   :3.454   Mean   :2.475   Mean   :2.47   Mean   :3.689  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:3.00   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.00   Max.   :5.000  
##       D31             SU32            Ca              Cb       
##  Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000  
##  1st Qu.:4.000   1st Qu.:4.00   1st Qu.:2.000   1st Qu.:4.000  
##  Median :4.000   Median :4.00   Median :3.000   Median :5.000  
##  Mean   :4.022   Mean   :4.06   Mean   :3.011   Mean   :4.372  
##  3rd Qu.:5.000   3rd Qu.:5.00   3rd Qu.:4.000   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :5.00   Max.   :5.000   Max.   :5.000  
##        Cc              Cd             Ce              Cf       
##  Min.   :1.000   Min.   :1.00   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.00   1st Qu.:3.500   1st Qu.:2.000  
##  Median :4.000   Median :4.00   Median :4.000   Median :3.000  
##  Mean   :3.689   Mean   :3.59   Mean   :3.995   Mean   :2.978  
##  3rd Qu.:4.000   3rd Qu.:4.00   3rd Qu.:5.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.00   Max.   :5.000   Max.   :5.000  
##        Cg              Ch              Da              Db       
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.000   1st Qu.:3.000   1st Qu.:2.000   1st Qu.:4.000  
##  Median :4.000   Median :4.000   Median :2.000   Median :4.000  
##  Mean   :3.852   Mean   :3.667   Mean   :2.568   Mean   :3.874  
##  3rd Qu.:5.000   3rd Qu.:4.000   3rd Qu.:3.000   3rd Qu.:4.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##        Dc             Dd              De              Df       
##  Min.   :1.00   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:3.00   1st Qu.:2.000   1st Qu.:3.000   1st Qu.:1.000  
##  Median :4.00   Median :4.000   Median :4.000   Median :2.000  
##  Mean   :3.71   Mean   :3.301   Mean   :3.475   Mean   :1.847  
##  3rd Qu.:4.00   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:2.000  
##  Max.   :5.00   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##        Dg              Dh              Di              Dj       
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   :1.000  
##  1st Qu.:2.000   1st Qu.:2.000   1st Qu.:2.000   1st Qu.:3.000  
##  Median :3.000   Median :3.000   Median :2.000   Median :4.000  
##  Mean   :2.929   Mean   :2.913   Mean   :2.639   Mean   :3.951  
##  3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:4.000   3rd Qu.:5.000  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :5.000  
##       Age           Attitude         Points      gender 
##  Min.   :17.00   Min.   :14.00   Min.   : 0.00   F:122  
##  1st Qu.:21.00   1st Qu.:26.00   1st Qu.:18.00   M: 61  
##  Median :22.00   Median :32.00   Median :22.00          
##  Mean   :25.58   Mean   :31.21   Mean   :20.61          
##  3rd Qu.:27.00   3rd Qu.:37.00   3rd Qu.:26.00          
##  Max.   :55.00   Max.   :50.00   Max.   :33.00
head(lrn14)
##   Aa Ab Ac Ad Ae Af ST01 SU02 D03 ST04 SU05 D06 D07 SU08 ST09 SU10 D11
## 1  3  1  2  1  1  1    4    2   4    4    2   4   4    3    3    2   3
## 2  2  2  2  2  1  1    4    2   4    4    4   2   3    4    4    1   4
## 3  4  1  1  1  1  1    3    1   4    4    2   3   4    1    3    1   4
## 4  4  2  3  2  1  1    3    3   4    4    3   4   4    2    3    1   3
## 5  3  2  2  1  2  1    4    2   5    3    4   4   4    3    4    2   4
## 6  4  2  1  1  1  1    4    3   5    4    3   5   5    4    4    1   5
##   ST12 SU13 D14 D15 SU16 ST17 SU18 D19 ST20 SU21 D22 D23 SU24 ST25 SU26
## 1    3    3   4   3    2    3    2   4    2    3   3   2    2    4    4
## 2    1    3   2   3    4    4    2   3    1    2   2   3    4    2    4
## 3    4    2   4   2    3    3    1   4    3    2   4   3    3    4    4
## 4    3    2   4   3    2    3    1   3    3    3   3   3    2    3    2
## 5    2    3   4   3    3    4    1   4    3    2   3   3    4    4    3
## 6    3    1   5   4    2    3    2   4    3    4   5   4    2    4    2
##   D27 ST28 SU29 D30 D31 SU32 Ca Cb Cc Cd Ce Cf Cg Ch Da Db Dc Dd De Df Dg
## 1   4    4    3   4   4    3  2  4  3  4  3  2  3  4  3  4  4  5  4  2  4
## 2   2    2    3   3   4    5  4  4  4  5  5  3  2  4  4  3  3  4  3  2  3
## 3   3    5    2   4   3    5  3  5  4  4  3  4  4  2  1  4  4  1  4  1  3
## 4   3    3    3   4   4    3  3  4  4  4  3  4  4  3  2  4  5  2  5  1  5
## 5   3    5    3   3   4    4  2  4  4  3  3  3  4  4  3  4  4  4  4  2  5
## 6   5    4    2   5   5    3  3  5  4  4  3  4  5  4  3  5  4  4  4  3  4
##   Dh Di Dj Age Attitude Points gender
## 1  3  4  4  53       37     25      F
## 2  3  2  4  55       31     12      M
## 3  1  1  5  49       25     24      F
## 4  4  2  5  53       35     10      M
## 5  5  3  3  49       37     22      M
## 6  3  3  5  38       38     21      F
  • View the structure and summary of the filtered “learning2014” data
## 'data.frame':    166 obs. of  8 variables:
##  $ X       : int  1 2 3 4 5 6 7 8 9 10 ...
##  $ gender  : Factor w/ 2 levels "F","M": 1 2 1 2 2 1 2 1 2 1 ...
##  $ Age     : int  53 55 49 53 49 38 50 37 37 42 ...
##  $ Attitude: int  37 31 25 35 37 38 35 29 38 21 ...
##  $ deep    : num  3.58 2.92 3.5 3.5 3.67 ...
##  $ stra    : num  3.38 2.75 3.62 3.12 3.62 ...
##  $ surf    : num  2.58 3.17 2.25 2.25 2.83 ...
##  $ Points  : int  25 12 24 10 22 21 21 31 24 26 ...
##        X          gender       Age           Attitude          deep      
##  Min.   :  1.00   F:110   Min.   :17.00   Min.   :14.00   Min.   :1.583  
##  1st Qu.: 42.25   M: 56   1st Qu.:21.00   1st Qu.:26.00   1st Qu.:3.333  
##  Median : 83.50           Median :22.00   Median :32.00   Median :3.667  
##  Mean   : 83.50           Mean   :25.51   Mean   :31.43   Mean   :3.680  
##  3rd Qu.:124.75           3rd Qu.:27.00   3rd Qu.:37.00   3rd Qu.:4.083  
##  Max.   :166.00           Max.   :55.00   Max.   :50.00   Max.   :4.917  
##       stra            surf           Points     
##  Min.   :1.250   Min.   :1.583   Min.   : 7.00  
##  1st Qu.:2.625   1st Qu.:2.417   1st Qu.:19.00  
##  Median :3.188   Median :2.833   Median :23.00  
##  Mean   :3.121   Mean   :2.787   Mean   :22.72  
##  3rd Qu.:3.625   3rd Qu.:3.167   3rd Qu.:27.75  
##  Max.   :5.000   Max.   :4.333   Max.   :33.00
##   X gender Age Attitude     deep  stra     surf Points
## 1 1      F  53       37 3.583333 3.375 2.583333     25
## 2 2      M  55       31 2.916667 2.750 3.166667     12
## 3 3      F  49       25 3.500000 3.625 2.250000     24
## 4 4      M  53       35 3.500000 3.125 2.250000     10
## 5 5      M  49       37 3.666667 3.625 2.833333     22
## 6 6      F  38       38 4.750000 3.625 2.416667     21

A careful observation of the loaded data shows you that from all the 63 original variables I filtered 7 variables of interest (Gender , Age, Attitude, Points, Deep questions, Surface questions, Strategic questions).

View data in Plots format

Graphs to visualize the overall relationships betwwen all the selected variables

Focusing on the diagonal set of graphs (7 variables by gender): You can already check that mainly in the Attitude variable the differences between gender are more noticeable;

From all the variables analysed, strategic_questions is the one that shows a more normal distributon, all the other data seems slighly to dramatically skewed.

  • Based in the previous observations it seems interesting to visualize how the attitute (that seems to vary most with gender) correlates with the acquired Points.

You can verify in the graph how the correlation trend varies between female (red line) and male (blue line). The grey area in the graph shows you how this data varies.

#Linear model with three explanatory variables 
my_model <- lm(formula = Points ~ Attitude + stra + surf, data = learning2014)

#Summary of the linear model 
summary(my_model)
## 
## Call:
## lm(formula = Points ~ Attitude + stra + surf, data = learning2014)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -17.1550  -3.4346   0.5156   3.6401  10.8952 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 11.01711    3.68375   2.991  0.00322 ** 
## Attitude     0.33952    0.05741   5.913 1.93e-08 ***
## stra         0.85313    0.54159   1.575  0.11716    
## surf        -0.58607    0.80138  -0.731  0.46563    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.296 on 162 degrees of freedom
## Multiple R-squared:  0.2074, Adjusted R-squared:  0.1927 
## F-statistic: 14.13 on 3 and 162 DF,  p-value: 3.156e-08

Analyses of the linear regression tell you that by each attitude point up the students have a chance of getting mote 0.34 points. This is the more significant relationship with the points obtained (p = 0.001)

#Linear model with three explanatory variables 
my_model <- lm(formula = Points ~ Attitude, data = learning2014)

#Summary of the linear model 
summary(my_model)
## 
## Call:
## lm(formula = Points ~ Attitude, data = learning2014)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -16.9763  -3.2119   0.4339   4.1534  10.6645 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 11.63715    1.83035   6.358 1.95e-09 ***
## Attitude     0.35255    0.05674   6.214 4.12e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.32 on 164 degrees of freedom
## Multiple R-squared:  0.1906, Adjusted R-squared:  0.1856 
## F-statistic: 38.61 on 1 and 164 DF,  p-value: 4.119e-09

Graphical model validation

Residuals vs Fitted plot

Normal Q-Q plot

library(ggfortify)
autoplot(my_model, which= 2) +
     theme_bw()


3 Logistic regression

This chapter introduces you the concept of logistic regression. Which in a very simplified matter meand how well your data fits to the idea of a linear correlation between the variables, arguments you are testing.

3.1 About this week working data set “Student Performance Data Set”.

“This data approach student achievement in secondary education of two Portuguese schools. The data attributes include student grades, demographic, social and school related features) and it was collected by using school reports and questionnaires. Two datasets are provided regarding the performance in two distinct subjects: Mathematics (mat) and Portuguese language (por). In [Cortez and Silva, 2008], the two datasets were modeled under binary/five-level classification and regression tasks (see paper source for more details).”

3.2 Load the combined data set from wrangling exercise from your local folder:

##       X school sex age address famsize Pstatus Medu Fedu     Mjob     Fjob
## 1     1     GP   F  18       U     GT3       A    4    4  at_home  teacher
## 2     2     GP   F  17       U     GT3       T    1    1  at_home    other
## 3     3     GP   F  15       U     LE3       T    1    1  at_home    other
## 4     4     GP   F  15       U     GT3       T    4    2   health services
## 5     5     GP   F  16       U     GT3       T    3    3    other    other
## 6     6     GP   M  16       U     LE3       T    4    3 services    other
## 7     7     GP   M  16       U     LE3       T    2    2    other    other
## 8     8     GP   F  17       U     GT3       A    4    4    other  teacher
## 9     9     GP   M  15       U     LE3       A    3    2 services    other
## 10   10     GP   M  15       U     GT3       T    3    4    other    other
## 11   11     GP   F  15       U     GT3       T    4    4  teacher   health
## 12   12     GP   F  15       U     GT3       T    2    1 services    other
## 13   13     GP   M  15       U     LE3       T    4    4   health services
## 14   14     GP   M  15       U     GT3       T    4    3  teacher    other
## 15   15     GP   M  15       U     GT3       A    2    2    other    other
## 16   16     GP   F  16       U     GT3       T    4    4   health    other
## 17   17     GP   F  16       U     GT3       T    4    4 services services
## 18   18     GP   F  16       U     GT3       T    3    3    other    other
## 19   19     GP   M  17       U     GT3       T    3    2 services services
## 20   20     GP   M  16       U     LE3       T    4    3   health    other
## 21   21     GP   M  15       U     GT3       T    4    3  teacher    other
## 22   22     GP   M  15       U     GT3       T    4    4   health   health
## 23   23     GP   M  16       U     LE3       T    4    2  teacher    other
## 24   24     GP   M  16       U     LE3       T    2    2    other    other
## 25   25     GP   F  15       R     GT3       T    2    4 services   health
## 26   26     GP   F  16       U     GT3       T    2    2 services services
## 27   27     GP   M  15       U     GT3       T    2    2    other    other
## 28   28     GP   M  15       U     GT3       T    4    2   health services
## 29   29     GP   M  16       U     LE3       A    3    4 services    other
## 30   30     GP   M  16       U     GT3       T    4    4  teacher  teacher
## 31   31     GP   M  15       U     GT3       T    4    4   health services
## 32   32     GP   M  15       U     GT3       T    4    4 services services
## 33   33     GP   M  15       R     GT3       T    4    3  teacher  at_home
## 34   34     GP   M  15       U     LE3       T    3    3    other    other
## 35   35     GP   M  16       U     GT3       T    3    2    other    other
## 36   36     GP   F  15       U     GT3       T    2    3    other    other
## 37   37     GP   M  15       U     LE3       T    4    3  teacher services
## 38   38     GP   M  16       R     GT3       A    4    4    other  teacher
## 39   39     GP   F  15       R     GT3       T    3    4 services   health
## 40   40     GP   F  15       R     GT3       T    2    2  at_home    other
## 41   41     GP   F  16       U     LE3       T    2    2    other    other
## 42   42     GP   M  15       U     LE3       T    4    4  teacher    other
## 43   43     GP   M  15       U     GT3       T    4    4 services  teacher
## 44   44     GP   M  15       U     GT3       T    2    2 services services
## 45   45     GP   F  16       U     LE3       T    2    2    other  at_home
## 46   46     GP   F  15       U     LE3       A    4    3    other    other
## 47   47     GP   F  16       U     LE3       A    3    3    other services
## 48   48     GP   M  16       U     GT3       T    4    3   health services
## 49   49     GP   M  15       U     GT3       T    4    2  teacher    other
## 50   50     GP   F  15       U     GT3       T    4    4 services  teacher
## 51   51     GP   F  16       U     LE3       T    2    2 services services
## 52   52     GP   F  15       U     LE3       T    4    2   health    other
## 53   53     GP   M  15       U     LE3       A    4    2   health   health
## 54   54     GP   F  15       U     GT3       T    4    4 services services
## 55   55     GP   F  15       U     LE3       A    3    3    other    other
## 56   56     GP   F  16       U     GT3       A    2    1    other    other
## 57   57     GP   F  15       U     GT3       A    4    3 services services
## 58   58     GP   M  15       U     GT3       T    4    4  teacher   health
## 59   59     GP   M  15       U     LE3       T    1    2    other  at_home
## 60   60     GP   F  16       U     GT3       T    4    2 services    other
## 61   61     GP   F  16       R     GT3       T    4    4   health  teacher
## 62   62     GP   F  16       U     GT3       T    1    1 services services
## 63   63     GP   F  16       U     LE3       T    1    2    other services
## 64   64     GP   F  16       U     GT3       T    4    3  teacher   health
## 65   65     GP   F  15       U     LE3       T    4    3 services services
## 66   66     GP   F  16       U     LE3       T    4    3  teacher services
## 67   67     GP   M  15       U     GT3       A    4    4    other services
## 68   68     GP   F  16       U     GT3       T    3    1 services    other
## 69   69     GP   F  15       R     LE3       T    2    2   health services
## 70   70     GP   F  15       R     LE3       T    3    1    other    other
## 71   71     GP   M  16       U     GT3       T    3    1    other    other
## 72   72     GP   M  15       U     GT3       T    4    2    other    other
## 73   73     GP   F  15       R     GT3       T    1    1    other    other
## 74   74     GP   M  16       U     GT3       T    3    1    other    other
## 75   75     GP   F  16       U     GT3       T    3    3    other services
## 76   76     GP   M  15       U     GT3       T    4    3  teacher    other
## 77   77     GP   M  15       U     GT3       T    4    0  teacher    other
## 78   78     GP   F  16       U     GT3       T    2    2    other    other
## 79   79     GP   M  17       U     GT3       T    2    1    other    other
## 80   80     GP   M  17       U     GT3       T    2    1    other    other
## 81   81     GP   F  16       U     GT3       T    3    4  at_home    other
## 82   82     GP   M  15       U     GT3       T    2    3    other services
## 83   83     GP   M  15       U     GT3       T    2    3    other    other
## 84   84     GP   F  15       U     LE3       T    3    2 services    other
## 85   85     GP   M  15       U     LE3       T    2    2 services services
## 86   86     GP   F  15       U     GT3       T    1    1    other    other
## 87   87     GP   F  15       U     GT3       T    4    4 services services
## 88   88     GP   F  16       U     LE3       T    2    2  at_home    other
## 89   89     GP   F  15       U     GT3       T    4    2    other    other
## 90   90     GP   M  16       U     GT3       T    2    2 services    other
## 91   91     GP   M  16       U     LE3       A    4    4  teacher   health
## 92   92     GP   F  16       U     GT3       T    3    3    other    other
## 93   93     GP   F  15       U     GT3       T    4    3 services    other
## 94   94     GP   F  16       U     LE3       T    3    1    other    other
## 95   95     GP   F  16       U     GT3       T    4    2  teacher services
## 96   96     GP   M  15       U     LE3       T    2    2 services   health
## 97   97     GP   F  15       R     GT3       T    1    1  at_home    other
## 98   98     GP   M  16       R     GT3       T    4    3 services    other
## 99   99     GP   F  16       U     GT3       T    2    1    other    other
## 100 100     GP   F  16       U     GT3       T    4    4    other    other
## 101 101     GP   F  16       U     GT3       T    4    3    other  at_home
## 102 102     GP   M  16       U     GT3       T    4    4 services services
## 103 103     GP   M  16       U     GT3       T    4    4 services  teacher
## 104 104     GP   M  15       U     GT3       T    4    4 services    other
## 105 105     GP   F  15       U     GT3       T    3    2 services    other
## 106 106     GP   M  15       U     GT3       A    3    4 services    other
## 107 107     GP   F  15       U     GT3       A    3    3    other   health
## 108 108     GP   F  15       U     GT3       T    2    2    other    other
## 109 109     GP   M  16       U     GT3       T    3    3 services    other
## 110 110     GP   M  16       U     GT3       T    3    3 services    other
## 111 111     GP   M  15       R     GT3       T    4    4    other    other
## 112 112     GP   F  16       U     LE3       T    4    4   health   health
## 113 113     GP   M  15       U     LE3       A    4    4  teacher  teacher
## 114 114     GP   F  16       R     GT3       T    3    3 services    other
## 115 115     GP   F  16       U     GT3       T    2    2  at_home    other
## 116 116     GP   M  15       U     LE3       T    4    2  teacher    other
## 117 117     GP   M  15       R     GT3       T    2    1   health services
## 118 118     GP   M  16       U     GT3       T    4    4  teacher  teacher
## 119 119     GP   M  16       U     GT3       T    4    4  teacher  teacher
## 120 120     GP   M  15       U     GT3       T    4    4    other  teacher
## 121 121     GP   M  16       U     GT3       T    3    3    other services
## 122 122     GP   M  17       R     GT3       T    1    3    other    other
## 123 123     GP   M  15       U     GT3       T    3    4    other    other
## 124 124     GP   F  15       U     GT3       T    1    2  at_home services
## 125 125     GP   M  15       U     GT3       T    2    2 services services
## 126 126     GP   F  16       U     LE3       T    2    4    other   health
## 127 127     GP   M  16       U     GT3       T    4    4   health    other
## 128 128     GP   F  16       U     GT3       T    2    2    other    other
## 129 129     GP   M  15       U     GT3       T    3    4 services services
## 130 130     GP   F  15       U     LE3       A    3    4    other    other
## 131 131     GP   F  19       U     GT3       T    0    1  at_home    other
## 132 132     GP   M  16       R     GT3       T    4    4  teacher  teacher
## 133 133     GP   F  15       R     GT3       T    3    4 services  teacher
## 134 134     GP   F  15       U     GT3       T    1    1  at_home    other
## 135 135     GP   F  17       U     LE3       T    2    2    other    other
## 136 136     GP   F  16       U     GT3       A    3    4 services    other
## 137 137     GP   M  15       R     GT3       T    3    4  at_home  teacher
## 138 138     GP   F  15       U     GT3       T    4    4 services  at_home
## 139 139     GP   M  17       R     GT3       T    3    4  at_home    other
## 140 140     GP   F  16       U     GT3       A    3    3    other    other
## 141 141     GP   M  16       U     LE3       T    1    1 services    other
## 142 142     GP   F  15       U     GT3       T    4    4  teacher  teacher
## 143 143     GP   M  15       U     GT3       T    4    3  teacher services
## 144 144     GP   M  16       U     LE3       T    2    2 services services
## 145 145     GP   F  15       U     GT3       T    4    4  teacher services
## 146 146     GP   F  16       U     LE3       T    1    1  at_home  at_home
## 147 147     GP   M  17       U     GT3       T    2    1    other    other
## 148 148     GP   M  17       U     GT3       T    2    1    other    other
## 149 149     GP   F  15       U     GT3       T    1    1    other services
## 150 150     GP   F  15       U     GT3       T    3    2   health services
## 151 151     GP   F  15       U     GT3       T    1    2  at_home    other
## 152 152     GP   M  16       U     GT3       T    4    4  teacher  teacher
## 153 153     GP   M  16       U     GT3       T    4    4  teacher  teacher
## 154 154     GP   M  15       U     LE3       A    2    1 services    other
## 155 155     GP   M  18       U     LE3       T    1    1    other    other
## 156 156     GP   M  16       U     LE3       T    2    1  at_home    other
## 157 157     GP   F  15       R     GT3       T    3    3 services services
## 158 158     GP   M  19       U     GT3       T    3    2 services  at_home
## 159 159     GP   F  17       U     GT3       T    4    4    other  teacher
## 160 160     GP   M  15       R     GT3       T    2    3  at_home services
## 161 161     GP   M  17       R     LE3       T    1    2    other    other
## 162 162     GP   F  18       R     GT3       T    1    1  at_home    other
## 163 163     GP   M  16       R     GT3       T    2    2  at_home    other
## 164 164     GP   M  16       U     GT3       T    3    3    other services
## 165 165     GP   M  17       R     LE3       T    2    1  at_home    other
## 166 166     GP   M  17       R     LE3       T    1    1    other services
## 167 167     GP   M  16       U     GT3       T    2    2    other    other
## 168 168     GP   F  16       U     GT3       T    4    2   health services
## 169 169     GP   F  16       U     GT3       T    2    2    other    other
## 170 170     GP   F  16       U     GT3       T    4    4   health   health
## 171 171     GP   M  16       U     GT3       T    3    4    other    other
## 172 172     GP   M  16       U     GT3       T    1    0    other    other
## 173 173     GP   M  17       U     LE3       T    4    4  teacher    other
## 174 174     GP   F  16       U     GT3       T    1    3  at_home services
## 175 175     GP   F  16       U     LE3       T    3    3    other    other
## 176 176     GP   M  17       U     LE3       T    4    3  teacher    other
## 177 177     GP   F  16       U     GT3       T    2    2 services    other
## 178 178     GP   M  17       U     GT3       T    3    3    other    other
## 179 179     GP   M  16       R     GT3       T    4    2  teacher services
## 180 180     GP   M  17       U     GT3       T    4    3    other    other
## 181 181     GP   M  16       U     GT3       T    4    3  teacher    other
## 182 182     GP   M  16       U     GT3       T    3    3 services    other
## 183 183     GP   M  16       U     GT3       T    3    3 services    other
## 184 184     GP   F  17       U     GT3       T    2    4 services services
## 185 185     GP   F  17       U     LE3       T    3    3    other    other
## 186 186     GP   F  16       U     GT3       T    3    2    other    other
## 187 187     GP   M  17       U     GT3       T    3    3 services services
## 188 188     GP   M  16       U     GT3       T    1    2 services services
## 189 189     GP   M  16       U     LE3       T    2    1    other    other
## 190 190     GP   F  17       U     GT3       A    3    3   health    other
## 191 191     GP   M  17       R     GT3       T    1    2  at_home    other
## 192 192     GP   F  16       U     GT3       T    2    3 services services
## 193 193     GP   F  17       U     GT3       T    1    1  at_home services
## 194 194     GP   M  17       U     GT3       T    1    2  at_home services
## 195 195     GP   M  16       R     GT3       T    3    3 services services
## 196 196     GP   M  16       U     GT3       T    2    3    other    other
## 197 197     GP   F  17       U     LE3       T    2    4 services services
## 198 198     GP   M  17       U     GT3       T    4    4 services  teacher
## 199 199     GP   M  16       R     LE3       T    3    3  teacher    other
## 200 200     GP   F  17       U     GT3       T    4    4 services  teacher
## 201 201     GP   F  16       U     LE3       T    4    4  teacher  teacher
## 202 202     GP   F  16       U     GT3       T    4    3   health    other
## 203 203     GP   F  16       U     GT3       T    2    3    other    other
## 204 204     GP   F  17       U     GT3       T    1    1    other    other
## 205 205     GP   F  17       R     GT3       T    2    2    other    other
## 206 206     GP   F  16       R     GT3       T    2    2 services services
## 207 207     GP   F  17       U     GT3       T    3    4  at_home services
## 208 208     GP   F  16       U     GT3       A    3    1 services    other
## 209 209     GP   F  16       U     GT3       T    4    3  teacher    other
## 210 210     GP   F  16       U     GT3       T    1    1  at_home    other
## 211 211     GP   F  17       R     GT3       T    4    3  teacher    other
## 212 212     GP   F  19       U     GT3       T    3    3    other    other
## 213 213     GP   M  17       U     LE3       T    4    4 services    other
## 214 214     GP   F  16       U     GT3       A    2    2    other    other
## 215 215     GP   M  18       U     GT3       T    2    2 services    other
## 216 216     GP   F  17       R     LE3       T    4    4 services    other
## 217 217     GP   F  17       U     LE3       T    3    2    other    other
## 218 218     GP   F  17       U     GT3       T    4    3    other    other
## 219 219     GP   M  18       U     LE3       T    3    3 services   health
## 220 220     GP   F  17       U     GT3       T    2    3  at_home    other
## 221 221     GP   F  17       U     GT3       T    2    2  at_home  at_home
## 222 222     GP   F  17       R     GT3       T    2    1  at_home services
## 223 223     GP   F  17       U     GT3       T    1    1  at_home    other
## 224 224     GP   F  16       U     GT3       T    2    3 services  teacher
## 225 225     GP   M  18       U     GT3       T    2    2    other    other
## 226 226     GP   F  16       U     GT3       T    4    4  teacher services
## 227 227     GP   F  18       R     GT3       T    3    1    other    other
## 228 228     GP   F  17       U     GT3       T    3    2    other    other
## 229 229     GP   M  17       U     LE3       T    2    3 services services
## 230 230     GP   M  18       U     LE3       T    2    1  at_home    other
## 231 231     GP   F  17       U     GT3       A    2    1    other    other
## 232 232     GP   F  17       U     LE3       T    4    3   health    other
## 233 233     GP   M  17       R     GT3       T    2    2    other    other
## 234 234     GP   M  17       U     GT3       T    4    4  teacher  teacher
## 235 235     GP   M  16       U     GT3       T    4    4   health    other
## 236 236     GP   M  16       U     LE3       T    1    1    other    other
## 237 237     GP   M  16       U     GT3       T    3    2  at_home    other
## 238 238     GP   M  17       U     LE3       T    2    2    other    other
## 239 239     GP   F  16       U     GT3       T    2    1    other    other
## 240 240     GP   F  17       R     GT3       T    2    1  at_home services
## 241 241     GP   M  18       U     GT3       T    2    2    other services
## 242 242     GP   M  17       U     LE3       T    4    3   health    other
## 243 243     GP   M  17       R     LE3       A    4    4  teacher    other
## 244 244     GP   M  16       U     LE3       T    4    3  teacher    other
## 245 245     GP   M  16       U     GT3       T    4    4 services services
## 246 246     GP   M  16       U     GT3       T    4    4 services services
## 247 247     GP   F  18       U     GT3       T    2    1    other    other
## 248 248     GP   M  16       U     GT3       T    2    1    other    other
## 249 249     GP   M  17       U     GT3       T    2    3    other    other
## 250 250     GP   M  22       U     GT3       T    3    1 services services
## 251 251     GP   M  18       R     LE3       T    3    3    other services
## 252 252     GP   M  16       U     GT3       T    0    2    other    other
## 253 253     GP   M  18       U     GT3       T    3    2 services    other
## 254 254     GP   M  16       U     GT3       T    3    3  at_home    other
## 255 255     GP   M  18       U     GT3       T    2    1 services services
## 256 256     GP   M  16       R     GT3       T    2    1    other    other
## 257 257     GP   M  17       R     GT3       T    2    1    other    other
## 258 258     GP   M  17       U     LE3       T    1    1   health    other
## 259 259     GP   F  17       U     LE3       T    4    2  teacher services
## 260 260     GP   M  19       U     LE3       A    4    3 services  at_home
## 261 261     GP   M  18       U     GT3       T    2    1    other    other
## 262 262     GP   F  17       U     LE3       T    2    2 services services
## 263 263     GP   F  18       U     GT3       T    4    3 services    other
## 264 264     GP   M  18       U     GT3       T    4    3  teacher    other
## 265 265     GP   M  18       R     GT3       T    3    2    other    other
## 266 266     GP   F  17       U     GT3       T    3    3    other    other
## 267 267     GP   F  18       U     GT3       T    2    2  at_home services
## 268 268     GP   M  18       R     LE3       A    3    4    other    other
## 269 269     GP   M  17       U     GT3       T    3    1 services    other
## 270 270     GP   F  18       R     GT3       T    4    4  teacher    other
## 271 271     GP   M  18       U     GT3       T    4    2   health    other
## 272 272     GP   F  18       R     GT3       T    2    1    other    other
## 273 273     GP   F  19       U     GT3       T    3    3    other services
## 274 274     GP   F  18       U     GT3       T    2    3    other services
## 275 275     GP   F  18       U     LE3       T    1    1    other    other
## 276 276     GP   M  17       R     GT3       T    1    2  at_home  at_home
## 277 277     GP   F  17       U     GT3       T    2    4  at_home   health
## 278 278     GP   F  17       U     LE3       T    2    2 services    other
## 279 279     GP   F  18       R     GT3       A    3    2    other services
## 280 280     GP   M  18       U     GT3       T    4    4  teacher services
## 281 281     GP   M  18       U     GT3       T    4    4  teacher services
## 282 282     GP   F  18       U     GT3       T    4    4   health   health
## 283 283     GP   M  18       U     LE3       T    4    3  teacher services
## 284 284     GP   M  17       U     LE3       A    4    1 services    other
## 285 285     GP   M  17       U     LE3       A    3    2  teacher services
## 286 286     GP   F  18       R     LE3       T    1    1  at_home    other
## 287 287     GP   F  18       U     GT3       T    1    1    other    other
## 288 288     GP   F  18       U     GT3       T    1    1    other    other
## 289 289     GP   F  17       U     GT3       T    2    2    other    other
## 290 290     GP   M  17       U     GT3       T    1    1    other    other
## 291 291     GP   F  18       U     GT3       T    2    2  at_home  at_home
## 292 292     GP   F  17       U     GT3       T    1    1 services  teacher
## 293 293     GP   M  18       U     GT3       T    2    1 services services
## 294 294     GP   M  18       U     LE3       A    4    4  teacher  teacher
## 295 295     GP   M  18       U     GT3       T    4    2  teacher    other
## 296 296     GP   F  17       U     GT3       T    4    3   health services
## 297 297     GP   F  17       R     LE3       T    3    1 services    other
## 298 298     GP   M  18       R     LE3       T    3    2 services    other
## 299 299     GP   M  17       U     GT3       T    3    3   health    other
## 300 300     GP   F  19       U     GT3       T    4    4   health    other
## 301 301     GP   F  18       U     LE3       T    4    3    other    other
## 302 302     GP   F  18       U     GT3       T    4    3    other    other
## 303 303     GP   M  18       U     LE3       T    4    4  teacher  teacher
## 304 304     GP   F  18       U     LE3       A    4    4   health    other
## 305 305     GP   M  17       U     LE3       T    4    4    other  teacher
## 306 306     GP   F  17       U     GT3       T    4    2    other    other
## 307 307     GP   F  17       U     GT3       T    3    2   health   health
## 308 308     GP   M  20       U     GT3       A    3    2 services    other
## 309 309     GP   M  19       R     GT3       T    3    3    other services
## 310 310     GP   F  18       U     GT3       T    2    1 services    other
## 311 311     GP   F  18       U     GT3       T    4    3    other    other
## 312 312     GP   F  17       R     GT3       T    3    4  at_home services
## 313 313     GP   F  18       U     GT3       T    4    4  teacher    other
## 314 314     GP   F  17       U     GT3       A    4    3 services services
## 315 315     GP   F  17       U     GT3       T    2    2    other    other
## 316 316     GP   F  17       R     LE3       T    2    2 services services
## 317 317     GP   F  17       U     GT3       T    3    1 services services
## 318 318     GP   F  17       U     LE3       T    0    2  at_home  at_home
## 319 319     GP   M  18       U     GT3       T    4    4    other    other
## 320 320     GP   M  17       U     GT3       T    3    3    other services
## 321 321     GP   M  17       R     GT3       T    2    2 services    other
## 322 322     GP   F  17       U     GT3       T    4    4  teacher services
## 323 323     GP   F  17       U     GT3       T    4    4  teacher services
## 324 324     GP   F  17       U     GT3       T    4    4  teacher  teacher
## 325 325     GP   M  18       U     LE3       T    2    2    other    other
## 326 326     GP   F  17       R     GT3       T    2    4  at_home    other
## 327 327     GP   F  18       U     GT3       T    3    3 services services
## 328 328     GP   F  18       U     LE3       T    2    2    other    other
## 329 329     GP   F  18       R     GT3       T    2    2  at_home    other
## 330 330     GP   F  17       U     GT3       T    3    4 services    other
## 331 331     GP   F  17       U     GT3       T    3    2    other    other
## 332 332     GP   F  18       U     LE3       T    3    3 services services
## 333 333     GP   F  17       R     GT3       A    3    2    other    other
## 334 334     GP   M  18       U     GT3       T    4    4  teacher services
## 335 335     GP   M  18       U     GT3       T    4    4  teacher services
## 336 336     GP   M  18       U     LE3       T    3    4 services    other
## 337 337     GP   F  17       U     GT3       A    2    2  at_home  at_home
## 338 338     GP   F  18       U     GT3       T    2    3  at_home    other
## 339 339     GP   F  18       U     GT3       T    3    2    other services
## 340 340     GP   M  18       R     GT3       T    4    3  teacher services
## 341 341     GP   M  18       U     GT3       T    4    3  teacher    other
## 342 342     GP   F  17       U     GT3       T    4    3   health    other
## 343 343     MS   M  18       R     GT3       T    3    2    other    other
## 344 344     MS   M  19       R     GT3       T    1    1    other services
## 345 345     MS   M  17       U     GT3       T    3    3   health    other
## 346 346     MS   M  18       U     LE3       T    1    3  at_home services
## 347 347     MS   M  19       R     GT3       T    1    1    other    other
## 348 348     MS   M  17       R     GT3       T    4    3 services    other
## 349 349     MS   F  18       U     GT3       T    3    3 services services
## 350 350     MS   F  17       R     GT3       T    4    4  teacher services
## 351 351     MS   F  17       U     LE3       A    3    2 services    other
## 352 352     MS   M  18       U     LE3       T    1    1    other services
## 353 353     MS   F  18       U     LE3       T    1    1  at_home services
## 354 354     MS   F  18       U     GT3       T    3    3 services services
## 355 355     MS   F  17       U     LE3       T    4    4  at_home  at_home
## 356 356     MS   F  17       R     GT3       T    1    2    other services
## 357 357     MS   M  18       R     GT3       T    1    3  at_home    other
## 358 358     MS   M  18       U     LE3       T    4    4  teacher services
## 359 359     MS   F  17       R     GT3       T    1    1    other services
## 360 360     MS   F  18       U     GT3       T    2    3  at_home services
## 361 361     MS   F  18       R     GT3       T    4    4    other  teacher
## 362 362     MS   M  18       R     LE3       T    1    2  at_home services
## 363 363     MS   F  17       U     GT3       T    2    2    other  at_home
## 364 364     MS   F  17       R     GT3       T    1    2    other    other
## 365 365     MS   F  18       R     LE3       T    4    4    other    other
## 366 366     MS   F  18       R     GT3       T    1    1    other    other
## 367 367     MS   F  18       R     LE3       T    4    4  teacher services
## 368 368     MS   F  18       U     GT3       T    3    3    other    other
## 369 369     MS   F  17       R     GT3       T    3    1  at_home    other
## 370 370     MS   M  18       U     GT3       T    4    4  teacher  teacher
## 371 371     MS   M  18       R     GT3       T    2    1    other    other
## 372 372     MS   M  17       U     GT3       T    2    3    other services
## 373 373     MS   M  19       R     GT3       T    1    1    other services
## 374 374     MS   M  18       R     GT3       T    4    2    other    other
## 375 375     MS   F  18       R     GT3       T    2    2  at_home    other
## 376 376     MS   F  18       R     GT3       T    4    4  teacher  at_home
## 377 377     MS   F  19       R     GT3       T    2    3 services    other
## 378 378     MS   F  18       U     LE3       T    3    1  teacher services
## 379 379     MS   F  18       U     GT3       T    1    1    other    other
## 380 380     MS   F  18       U     GT3       T    1    1    other    other
## 381 381     MS   M  17       U     LE3       T    3    1 services services
## 382 382     MS   M  18       R     LE3       T    3    2 services    other
##         reason nursery internet guardian traveltime studytime failures
## 1       course     yes       no   mother          2         2        0
## 2       course      no      yes   father          1         2        0
## 3        other     yes      yes   mother          1         2        2
## 4         home     yes      yes   mother          1         3        0
## 5         home     yes       no   father          1         2        0
## 6   reputation     yes      yes   mother          1         2        0
## 7         home     yes      yes   mother          1         2        0
## 8         home     yes       no   mother          2         2        0
## 9         home     yes      yes   mother          1         2        0
## 10        home     yes      yes   mother          1         2        0
## 11  reputation     yes      yes   mother          1         2        0
## 12  reputation     yes      yes   father          3         3        0
## 13      course     yes      yes   father          1         1        0
## 14      course     yes      yes   mother          2         2        0
## 15        home     yes      yes    other          1         3        0
## 16        home     yes      yes   mother          1         1        0
## 17  reputation     yes      yes   mother          1         3        0
## 18  reputation     yes       no   mother          3         2        0
## 19      course     yes      yes   mother          1         1        3
## 20        home     yes      yes   father          1         1        0
## 21  reputation     yes      yes   mother          1         2        0
## 22       other     yes      yes   father          1         1        0
## 23      course     yes      yes   mother          1         2        0
## 24  reputation     yes      yes   mother          2         2        0
## 25      course     yes      yes   mother          1         3        0
## 26        home      no      yes   mother          1         1        1
## 27        home     yes      yes   mother          1         1        0
## 28       other     yes      yes   mother          1         1        0
## 29        home     yes      yes   mother          1         2        0
## 30        home     yes      yes   mother          1         2        0
## 31        home      no      yes   mother          1         2        0
## 32  reputation     yes      yes   mother          2         2        0
## 33      course     yes      yes   mother          1         2        0
## 34      course      no      yes   mother          1         2        0
## 35        home      no      yes   mother          1         1        0
## 36       other     yes       no   father          2         1        0
## 37        home     yes      yes   mother          1         3        0
## 38  reputation     yes      yes   mother          2         3        0
## 39      course     yes      yes   mother          1         3        0
## 40  reputation     yes       no   mother          1         1        0
## 41        home      no      yes   mother          2         2        0
## 42        home      no      yes    other          1         1        0
## 43      course     yes      yes   father          1         2        0
## 44      course     yes      yes   father          1         1        0
## 45      course     yes      yes   father          2         2        1
## 46      course     yes      yes   mother          1         2        0
## 47        home     yes      yes   mother          1         2        0
## 48  reputation     yes      yes   mother          1         4        0
## 49        home     yes       no   mother          1         2        0
## 50       other      no      yes   father          1         2        0
## 51      course     yes      yes   mother          3         2        0
## 52       other     yes      yes   mother          1         2        0
## 53       other     yes       no   father          2         1        0
## 54      course     yes      yes   mother          1         1        0
## 55       other     yes      yes   mother          1         1        0
## 56       other     yes      yes   mother          1         2        0
## 57  reputation     yes      yes   mother          1         2        0
## 58  reputation     yes       no   mother          1         2        0
## 59        home     yes      yes   father          1         2        0
## 60      course     yes      yes   mother          1         2        0
## 61       other     yes       no   mother          1         2        0
## 62      course      no      yes   father          4         1        0
## 63  reputation     yes      yes   father          1         2        0
## 64        home     yes      yes   mother          1         3        0
## 65  reputation     yes      yes   father          1         2        0
## 66      course     yes      yes   mother          3         2        0
## 67  reputation      no      yes   mother          1         4        0
## 68      course     yes      yes   mother          1         4        0
## 69  reputation     yes      yes   mother          2         2        0
## 70  reputation      no      yes   father          2         4        0
## 71  reputation     yes      yes   father          2         4        0
## 72      course     yes      yes   mother          1         4        0
## 73  reputation      no      yes   mother          1         2        1
## 74  reputation     yes       no   mother          1         1        0
## 75        home     yes      yes   mother          1         2        0
## 76        home     yes      yes   mother          1         2        0
## 77      course     yes      yes   mother          2         4        0
## 78  reputation     yes      yes   mother          1         4        0
## 79        home     yes      yes   mother          2         1        3
## 80        home     yes      yes   mother          2         1        2
## 81      course     yes      yes   mother          1         2        0
## 82      course      no      yes   father          1         1        0
## 83        home      no      yes   mother          1         3        0
## 84  reputation     yes      yes   mother          1         2        0
## 85        home     yes      yes   mother          2         2        0
## 86        home      no      yes   father          1         2        0
## 87  reputation     yes      yes   father          2         2        1
## 88      course     yes       no   mother          1         2        0
## 89  reputation     yes      yes   mother          1         3        0
## 90  reputation      no      yes   father          2         2        0
## 91  reputation     yes       no   mother          1         2        0
## 92        home     yes      yes   mother          1         3        0
## 93  reputation     yes      yes   mother          1         1        0
## 94        home     yes       no   father          1         2        0
## 95        home     yes      yes   mother          2         2        0
## 96  reputation     yes      yes   mother          1         4        0
## 97        home     yes      yes   mother          2         4        0
## 98  reputation      no      yes   mother          2         1        0
## 99      course     yes       no   mother          1         2        0
## 100 reputation      no      yes   mother          1         1        0
## 101     course     yes      yes   mother          1         3        0
## 102      other     yes      yes   mother          1         1        0
## 103      other     yes      yes   father          1         3        0
## 104     course      no      yes   mother          1         1        0
## 105       home     yes      yes   mother          2         2        0
## 106     course     yes      yes   mother          1         2        0
## 107 reputation     yes       no   father          1         4        0
## 108     course     yes      yes   mother          1         4        0
## 109       home     yes      yes   father          1         3        0
## 110       home     yes      yes   father          1         2        0
## 111       home     yes      yes   father          4         4        0
## 112      other     yes      yes   mother          1         3        0
## 113     course     yes      yes   mother          1         1        0
## 114 reputation     yes      yes   father          1         3        0
## 115       home     yes      yes   mother          1         2        1
## 116     course     yes      yes   mother          1         1        0
## 117 reputation     yes      yes   mother          1         2        0
## 118     course     yes      yes   father          1         2        0
## 119     course     yes      yes   father          1         2        0
## 120 reputation     yes       no   father          2         2        0
## 121       home     yes      yes   father          2         1        0
## 122     course     yes      yes   father          3         2        1
## 123 reputation     yes      yes   father          1         1        0
## 124     course      no      yes   mother          1         2        0
## 125       home     yes      yes   father          1         4        0
## 126     course     yes      yes   father          2         2        0
## 127     course     yes      yes   mother          1         1        0
## 128       home     yes      yes   mother          1         2        0
## 129       home     yes      yes   father          1         1        0
## 130       home     yes      yes   mother          1         2        0
## 131     course      no       no    other          1         2        2
## 132     course     yes      yes   mother          1         1        0
## 133     course     yes      yes   father          2         3        1
## 134     course      no      yes   mother          3         1        0
## 135     course     yes      yes   father          1         1        0
## 136     course     yes      yes   father          1         1        0
## 137     course     yes       no   mother          4         2        0
## 138     course     yes      yes   mother          1         3        0
## 139     course     yes       no   mother          3         2        0
## 140     course      no      yes    other          2         1        1
## 141     course     yes       no   mother          1         2        2
## 142     course     yes      yes   mother          2         1        0
## 143     course     yes      yes   father          2         4        0
## 144 reputation     yes      yes   father          2         1        1
## 145     course     yes      yes   mother          1         3        0
## 146     course     yes      yes   mother          1         1        0
## 147       home     yes      yes   mother          2         1        3
## 148       home     yes      yes   mother          1         1        2
## 149     course     yes      yes   father          1         2        0
## 150       home     yes      yes   father          1         2        2
## 151     course      no      yes   mother          1         2        0
## 152     course     yes      yes   mother          1         2        0
## 153     course     yes      yes   mother          1         1        0
## 154     course     yes      yes   mother          4         1        2
## 155     course     yes      yes   mother          1         1        2
## 156     course     yes       no   mother          1         1        1
## 157 reputation     yes      yes    other          2         3        1
## 158       home     yes      yes   mother          1         1        2
## 159     course     yes       no   mother          1         1        0
## 160     course     yes       no   mother          1         2        0
## 161 reputation     yes       no   mother          1         1        2
## 162     course      no       no   mother          3         1        3
## 163     course      no       no   mother          3         1        0
## 164     course     yes      yes   father          1         2        1
## 165     course     yes      yes   mother          2         1        2
## 166     course     yes       no   mother          4         2        2
## 167     course     yes      yes   father          1         2        0
## 168       home     yes      yes   father          1         2        0
## 169       home      no      yes   mother          1         2        0
## 170 reputation     yes      yes   mother          1         2        0
## 171     course      no      yes   father          3         1        2
## 172 reputation     yes      yes   mother          2         2        0
## 173 reputation     yes      yes   mother          1         2        0
## 174       home      no      yes   mother          1         2        2
## 175 reputation     yes      yes   mother          2         2        0
## 176     course     yes      yes   mother          2         2        0
## 177 reputation      no      yes   mother          2         2        0
## 178 reputation      no      yes   father          1         2        0
## 179      other     yes      yes   mother          1         1        0
## 180     course     yes      yes   mother          1         2        0
## 181       home     yes      yes   mother          1         2        0
## 182       home     yes      yes   mother          1         2        0
## 183       home     yes      yes   mother          1         2        0
## 184 reputation     yes       no   father          1         2        0
## 185 reputation     yes      yes   mother          1         2        0
## 186 reputation     yes      yes   mother          1         2        0
## 187      other     yes      yes   mother          1         2        0
## 188      other     yes      yes   mother          1         1        0
## 189     course     yes      yes   mother          1         2        0
## 190 reputation      no      yes   mother          1         2        0
## 191       home     yes       no   mother          1         2        0
## 192     course     yes      yes   mother          1         2        0
## 193     course     yes      yes   mother          1         2        0
## 194      other      no      yes    other          2         2        0
## 195 reputation     yes      yes   mother          1         1        0
## 196       home     yes      yes   father          2         1        0
## 197     course     yes      yes   father          1         2        0
## 198       home     yes      yes   mother          1         1        0
## 199       home     yes      yes   father          3         1        0
## 200       home     yes      yes   mother          2         1        1
## 201 reputation     yes      yes   mother          1         2        0
## 202       home     yes      yes   mother          1         2        0
## 203 reputation     yes       no   mother          1         2        0
## 204     course      no       no   mother          1         2        0
## 205 reputation     yes      yes   mother          1         1        0
## 206 reputation      no      yes   mother          2         4        0
## 207       home     yes      yes   mother          1         3        1
## 208     course     yes      yes   mother          1         2        2
## 209      other     yes      yes   mother          1         2        0
## 210       home     yes       no   mother          2         1        0
## 211 reputation     yes      yes   mother          2         3        0
## 212 reputation     yes      yes    other          1         4        0
## 213       home     yes      yes   mother          1         2        0
## 214 reputation     yes      yes   mother          1         2        0
## 215       home     yes      yes   mother          1         2        0
## 216      other     yes       no   mother          1         1        0
## 217 reputation     yes      yes   mother          2         2        0
## 218 reputation     yes      yes   mother          1         2        1
## 219       home     yes      yes   father          1         2        0
## 220       home     yes       no   father          2         1        0
## 221     course     yes      yes   mother          1         3        0
## 222 reputation     yes      yes   mother          2         2        0
## 223 reputation     yes       no   mother          1         3        0
## 224      other     yes      yes   mother          1         2        0
## 225       home     yes      yes   mother          2         2        2
## 226       home      no      yes   mother          1         3        0
## 227 reputation     yes      yes   mother          1         2        0
## 228     course      no      yes   mother          1         2        0
## 229 reputation      no      yes   father          1         2        0
## 230     course     yes      yes   mother          4         2        0
## 231     course     yes      yes   mother          2         3        0
## 232 reputation     yes      yes   father          1         2        0
## 233     course     yes      yes   father          2         2        0
## 234 reputation     yes      yes   mother          1         2        0
## 235 reputation     yes      yes   father          1         2        0
## 236       home     yes      yes   mother          2         2        0
## 237 reputation     yes      yes   mother          2         3        0
## 238       home      no      yes   father          1         2        0
## 239       home     yes      yes   mother          1         1        0
## 240     course     yes       no   mother          3         2        0
## 241 reputation     yes      yes   father          1         2        0
## 242     course     yes      yes   mother          2         2        0
## 243     course     yes      yes   mother          2         2        0
## 244     course      no      yes   mother          1         1        0
## 245     course     yes      yes   mother          1         2        0
## 246     course     yes      yes   mother          1         1        0
## 247     course      no      yes    other          2         3        0
## 248     course     yes      yes   mother          3         1        0
## 249     course     yes      yes   father          2         1        0
## 250      other      no      yes   mother          1         1        3
## 251     course     yes      yes   mother          1         2        0
## 252      other      no      yes   mother          1         1        0
## 253     course     yes      yes   mother          2         1        0
## 254 reputation      no      yes    other          3         2        0
## 255      other      no      yes   mother          1         1        2
## 256     course      no       no   mother          2         1        0
## 257     course      no      yes   mother          1         1        0
## 258     course     yes      yes   mother          2         1        1
## 259 reputation     yes      yes   mother          1         4        0
## 260 reputation     yes      yes   mother          1         2        0
## 261       home     yes      yes   mother          1         2        0
## 262     course     yes      yes   father          1         4        0
## 263       home     yes      yes   father          1         2        0
## 264     course      no      yes   mother          1         2        0
## 265     course      no       no   mother          1         3        0
## 266       home      no       no   mother          1         3        0
## 267       home     yes      yes   mother          1         3        0
## 268 reputation     yes      yes   mother          2         2        0
## 269      other     yes      yes   mother          1         2        0
## 270 reputation     yes      yes   mother          2         2        0
## 271 reputation     yes      yes   father          1         2        0
## 272 reputation     yes      yes   mother          2         2        0
## 273       home     yes      yes    other          1         2        1
## 274 reputation     yes      yes   father          1         4        0
## 275       home      no       no   mother          2         2        0
## 276       home      no       no   mother          1         2        0
## 277 reputation     yes      yes   mother          2         2        0
## 278     course     yes      yes   mother          2         2        0
## 279       home      no      yes   mother          2         2        0
## 280       home     yes      yes   mother          2         1        0
## 281       home     yes      yes   mother          2         2        0
## 282 reputation     yes      yes   father          1         2        1
## 283     course     yes      yes   mother          2         1        0
## 284       home     yes      yes   mother          2         1        0
## 285       home     yes      yes   mother          1         1        0
## 286 reputation     yes       no   mother          2         4        0
## 287       home     yes      yes   mother          2         2        0
## 288       home     yes      yes   mother          2         2        0
## 289     course      no      yes   mother          1         2        0
## 290 reputation      no      yes   father          1         2        0
## 291      other     yes      yes   mother          1         3        0
## 292 reputation     yes      yes   mother          1         3        0
## 293 reputation     yes      yes   mother          1         3        0
## 294 reputation     yes      yes   mother          1         2        0
## 295       home     yes      yes   mother          1         2        0
## 296 reputation     yes      yes   mother          1         3        0
## 297 reputation     yes       no   mother          2         4        0
## 298 reputation     yes      yes   mother          2         3        0
## 299       home     yes      yes   mother          1         1        0
## 300 reputation     yes      yes    other          2         2        0
## 301       home     yes      yes    other          2         2        0
## 302 reputation     yes      yes   father          1         4        0
## 303       home     yes      yes   mother          1         1        0
## 304       home     yes      yes   mother          1         2        0
## 305       home     yes      yes   father          2         1        0
## 306 reputation     yes      yes   mother          2         3        0
## 307 reputation      no      yes   father          1         4        0
## 308     course     yes       no    other          1         1        1
## 309 reputation     yes       no   father          1         2        0
## 310     course     yes      yes   mother          2         2        0
## 311     course     yes      yes   mother          1         3        0
## 312     course      no      yes   father          1         3        0
## 313     course     yes      yes   mother          1         2        0
## 314     course     yes      yes   mother          1         2        0
## 315     course     yes       no   mother          1         2        0
## 316     course     yes      yes   mother          1         3        0
## 317     course      no      yes   father          1         3        0
## 318       home     yes      yes   father          2         3        0
## 319     course     yes      yes   mother          1         3        0
## 320 reputation      no      yes   mother          1         1        0
## 321     course     yes      yes   mother          4         1        0
## 322     course     yes      yes   mother          1         2        0
## 323     course     yes      yes   mother          1         3        0
## 324     course      no      yes   mother          2         3        0
## 325     course     yes      yes   mother          1         4        0
## 326     course     yes      yes   father          1         3        0
## 327       home     yes      yes   mother          1         2        0
## 328       home      no      yes    other          1         2        0
## 329     course     yes       no   mother          2         4        0
## 330     course     yes      yes   mother          1         3        0
## 331       home     yes      yes   mother          1         2        0
## 332       home     yes      yes   mother          1         4        0
## 333       home     yes      yes   mother          1         2        0
## 334       home     yes      yes   father          2         2        0
## 335       home     yes      yes   father          1         2        0
## 336       home     yes      yes   mother          1         2        0
## 337       home     yes      yes   father          1         2        0
## 338     course     yes      yes   mother          1         3        0
## 339      other     yes      yes   mother          1         3        0
## 340     course     yes      yes   mother          1         3        0
## 341     course     yes      yes   mother          1         3        0
## 342 reputation     yes      yes   mother          1         3        0
## 343     course      no      yes   mother          2         1        0
## 344       home     yes      yes    other          3         2        2
## 345     course     yes      yes   mother          2         2        0
## 346     course     yes      yes   mother          1         1        0
## 347       home     yes      yes    other          3         1        1
## 348       home      no      yes   mother          2         2        0
## 349     course     yes       no   father          1         2        0
## 350      other     yes      yes   father          2         2        0
## 351 reputation     yes       no   mother          2         2        0
## 352       home      no      yes   father          2         1        0
## 353     course     yes      yes   father          2         3        0
## 354      other     yes      yes   mother          2         2        0
## 355     course     yes      yes   mother          1         2        0
## 356     course      no       no   father          2         2        0
## 357     course     yes       no   mother          2         2        0
## 358      other     yes      yes   mother          2         3        0
## 359 reputation     yes      yes   mother          3         1        1
## 360     course     yes      yes   father          2         1        0
## 361      other      no      yes   father          3         2        0
## 362      other     yes      yes   father          3         1        0
## 363       home     yes       no   mother          1         3        0
## 364     course     yes      yes   mother          1         1        0
## 365 reputation     yes      yes   mother          2         3        0
## 366       home     yes      yes   mother          4         3        0
## 367     course     yes      yes   mother          1         2        0
## 368       home     yes      yes   mother          1         2        0
## 369 reputation      no      yes   mother          1         2        0
## 370       home      no      yes   father          1         2        0
## 371      other      no      yes   mother          2         1        0
## 372       home     yes      yes   father          2         2        0
## 373      other     yes       no   mother          2         1        1
## 374       home     yes       no   father          2         1        1
## 375      other     yes       no   mother          2         3        0
## 376 reputation     yes      yes   mother          3         1        0
## 377     course      no      yes   mother          1         3        1
## 378     course     yes      yes   mother          1         2        0
## 379     course     yes       no   mother          2         2        2
## 380     course     yes       no   mother          2         2        0
## 381     course      no      yes   mother          2         1        0
## 382     course      no      yes   mother          3         1        0
##     schoolsup famsup paid activities higher romantic famrel freetime goout
## 1         yes     no   no         no    yes       no      4        3     4
## 2          no    yes   no         no    yes       no      5        3     3
## 3         yes     no  yes         no    yes       no      4        3     2
## 4          no    yes  yes        yes    yes      yes      3        2     2
## 5          no    yes  yes         no    yes       no      4        3     2
## 6          no    yes  yes        yes    yes       no      5        4     2
## 7          no     no   no         no    yes       no      4        4     4
## 8         yes    yes   no         no    yes       no      4        1     4
## 9          no    yes  yes         no    yes       no      4        2     2
## 10         no    yes  yes        yes    yes       no      5        5     1
## 11         no    yes  yes         no    yes       no      3        3     3
## 12         no    yes   no        yes    yes       no      5        2     2
## 13         no    yes  yes        yes    yes       no      4        3     3
## 14         no    yes  yes         no    yes       no      5        4     3
## 15         no    yes   no         no    yes      yes      4        5     2
## 16         no    yes   no         no    yes       no      4        4     4
## 17         no    yes  yes        yes    yes       no      3        2     3
## 18        yes    yes   no        yes    yes       no      5        3     2
## 19         no    yes   no        yes    yes       no      5        5     5
## 20         no     no  yes        yes    yes       no      3        1     3
## 21         no     no   no         no    yes       no      4        4     1
## 22         no    yes  yes         no    yes       no      5        4     2
## 23         no     no   no        yes    yes       no      4        5     1
## 24         no    yes   no        yes    yes       no      5        4     4
## 25        yes    yes  yes        yes    yes       no      4        3     2
## 26         no    yes  yes         no    yes       no      1        2     2
## 27         no    yes  yes         no    yes       no      4        2     2
## 28         no     no  yes         no    yes       no      2        2     4
## 29        yes    yes   no        yes    yes       no      5        3     3
## 30         no    yes  yes        yes    yes      yes      4        4     5
## 31         no    yes  yes         no    yes       no      5        4     2
## 32         no    yes   no        yes    yes       no      4        3     1
## 33         no    yes   no        yes    yes      yes      4        5     2
## 34         no     no   no        yes    yes       no      5        3     2
## 35         no    yes  yes         no    yes       no      5        4     3
## 36         no    yes   no        yes    yes       no      3        5     1
## 37         no    yes   no        yes    yes       no      5        4     3
## 38         no    yes   no        yes    yes      yes      2        4     3
## 39        yes    yes  yes        yes    yes       no      4        3     2
## 40        yes    yes  yes        yes    yes       no      4        3     1
## 41         no    yes   no        yes    yes      yes      3        3     3
## 42         no    yes   no         no    yes      yes      5        4     3
## 43         no    yes   no        yes    yes       no      4        3     3
## 44        yes    yes   no         no    yes       no      5        4     1
## 45        yes     no   no        yes    yes       no      4        3     3
## 46        yes    yes  yes        yes    yes      yes      5        2     2
## 47         no    yes   no         no    yes       no      2        3     5
## 48         no     no   no        yes    yes       no      4        2     2
## 49         no    yes  yes         no    yes       no      4        3     3
## 50        yes    yes   no        yes    yes       no      4        4     4
## 51         no    yes  yes         no    yes       no      4        3     3
## 52         no    yes  yes         no    yes       no      4        3     3
## 53         no     no   no         no    yes       no      5        5     5
## 54        yes    yes  yes         no    yes       no      3        3     4
## 55         no     no  yes         no    yes       no      5        3     4
## 56         no     no  yes        yes    yes      yes      5        3     4
## 57         no    yes  yes        yes    yes       no      4        3     2
## 58         no    yes   no        yes    yes       no      3        2     2
## 59        yes    yes   no        yes    yes       no      4        3     2
## 60         no    yes   no         no    yes       no      4        2     3
## 61         no    yes   no        yes    yes       no      2        4     4
## 62        yes    yes   no        yes    yes      yes      5        5     5
## 63        yes     no   no        yes    yes       no      4        4     3
## 64        yes    yes  yes        yes    yes       no      3        4     4
## 65        yes     no   no        yes    yes      yes      4        4     4
## 66         no    yes   no        yes    yes       no      5        4     3
## 67         no    yes   no        yes    yes      yes      1        3     3
## 68        yes    yes  yes         no    yes       no      4        3     3
## 69        yes    yes  yes         no    yes       no      4        1     3
## 70         no    yes   no         no    yes       no      4        4     2
## 71         no    yes  yes         no    yes       no      4        3     2
## 72         no     no   no         no    yes       no      3        3     3
## 73        yes    yes   no         no    yes      yes      3        3     4
## 74         no     no   no        yes    yes       no      5        3     2
## 75        yes    yes  yes        yes    yes       no      4        3     3
## 76         no    yes  yes        yes    yes       no      4        3     3
## 77         no     no   no        yes    yes       no      3        4     3
## 78         no     no  yes         no    yes      yes      5        2     3
## 79        yes    yes   no        yes     no       no      4        5     1
## 80        yes    yes   no        yes     no       no      4        4     3
## 81         no    yes   no         no    yes       no      2        4     3
## 82        yes    yes  yes        yes    yes      yes      3        2     2
## 83        yes     no  yes         no    yes       no      5        3     2
## 84         no    yes  yes         no    yes       no      4        4     4
## 85         no     no  yes        yes    yes       no      5        3     3
## 86         no    yes   no        yes    yes       no      4        3     2
## 87         no     no  yes         no    yes      yes      4        4     4
## 88         no    yes   no         no    yes       no      4        3     4
## 89         no    yes   no        yes    yes       no      5        3     3
## 90         no     no  yes        yes    yes       no      4        4     2
## 91         no    yes   no         no    yes       no      4        1     3
## 92         no    yes  yes         no    yes      yes      4        3     3
## 93         no     no  yes        yes    yes       no      4        5     5
## 94        yes    yes   no         no    yes       no      3        3     3
## 95         no    yes  yes        yes    yes       no      5        3     3
## 96         no    yes   no        yes    yes       no      4        3     4
## 97        yes    yes  yes        yes    yes       no      3        1     2
## 98        yes    yes   no        yes    yes       no      3        3     3
## 99         no    yes  yes         no    yes      yes      4        3     5
## 100        no     no   no        yes    yes       no      5        3     4
## 101       yes    yes  yes         no    yes       no      5        3     5
## 102       yes    yes  yes        yes    yes       no      4        5     5
## 103        no    yes   no        yes    yes      yes      4        4     3
## 104        no    yes   no        yes    yes       no      5        3     3
## 105       yes    yes  yes         no    yes       no      4        3     5
## 106        no    yes  yes        yes    yes       no      5        4     4
## 107       yes     no   no         no    yes       no      4        3     3
## 108       yes    yes  yes         no    yes       no      5        1     2
## 109        no    yes   no        yes    yes       no      5        3     3
## 110        no    yes   no        yes    yes       no      4        2     3
## 111        no    yes  yes        yes    yes      yes      1        3     5
## 112        no    yes  yes        yes    yes      yes      5        4     5
## 113        no     no   no        yes    yes       no      5        5     3
## 114       yes    yes   no        yes    yes       no      4        1     2
## 115       yes     no   no        yes    yes       no      3        1     2
## 116        no     no   no         no    yes       no      3        5     2
## 117        no     no   no        yes    yes      yes      5        4     2
## 118        no    yes   no        yes    yes       no      5        4     4
## 119        no    yes   no        yes    yes       no      4        4     3
## 120        no    yes   no        yes    yes       no      4        4     3
## 121        no     no   no        yes    yes       no      5        4     2
## 122        no    yes   no        yes    yes       no      5        2     4
## 123        no     no   no         no    yes       no      3        4     3
## 124        no     no   no         no    yes       no      3        2     3
## 125        no    yes  yes        yes    yes       no      5        5     4
## 126        no    yes  yes        yes    yes      yes      4        2     2
## 127        no    yes   no        yes    yes       no      3        4     4
## 128        no     no  yes         no    yes      yes      5        4     4
## 129       yes     no   no         no    yes       no      5        5     5
## 130       yes     no   no        yes    yes      yes      5        3     2
## 131        no    yes   no         no     no       no      3        4     2
## 132        no     no  yes        yes    yes       no      3        5     5
## 133        no    yes   no         no    yes      yes      4        2     2
## 134        no    yes   no        yes    yes      yes      4        3     3
## 135        no    yes   no         no    yes      yes      3        4     4
## 136        no     no   no         no    yes       no      3        2     1
## 137        no    yes   no         no    yes      yes      5        3     3
## 138        no    yes   no        yes    yes      yes      4        3     3
## 139        no     no   no         no    yes       no      5        4     5
## 140        no    yes   no        yes    yes      yes      4        3     2
## 141        no     no   no         no    yes      yes      4        4     4
## 142        no     no   no        yes    yes       no      4        3     2
## 143       yes    yes   no         no    yes       no      2        2     2
## 144        no    yes   no        yes    yes       no      2        3     3
## 145        no    yes  yes        yes    yes       no      4        2     2
## 146        no     no   no         no    yes       no      3        4     4
## 147        no    yes   no         no    yes       no      4        4     3
## 148        no    yes   no         no    yes       no      5        4     5
## 149        no    yes  yes         no    yes       no      4        4     2
## 150        no    yes   no         no    yes       no      3        3     2
## 151        no    yes  yes         no    yes       no      4        3     2
## 152        no    yes   no         no     no      yes      4        4     3
## 153        no    yes   no         no     no      yes      3        3     2
## 154        no     no   no         no    yes       no      4        5     5
## 155        no     no   no         no     no      yes      2        3     5
## 156        no     no   no        yes    yes      yes      4        4     4
## 157        no    yes  yes        yes    yes      yes      4        2     1
## 158        no    yes   no         no     no      yes      4        5     4
## 159       yes    yes   no         no    yes      yes      4        2     1
## 160       yes     no  yes        yes    yes       no      4        4     4
## 161        no     no   no         no    yes       no      2        2     2
## 162        no    yes   no        yes    yes       no      5        2     5
## 163        no     no   no         no    yes       no      4        2     2
## 164        no    yes  yes         no    yes      yes      4        5     5
## 165        no     no   no        yes     no      yes      3        3     2
## 166        no     no   no        yes     no      yes      5        3     5
## 167        no     no   no         no     no       no      4        3     5
## 168        no     no  yes         no    yes      yes      4        2     3
## 169        no    yes  yes         no    yes       no      5        1     5
## 170        no    yes  yes         no    yes      yes      4        4     2
## 171        no    yes   no        yes    yes       no      3        4     5
## 172        no    yes  yes        yes    yes      yes      4        3     2
## 173        no    yes  yes        yes    yes       no      4        4     4
## 174        no     no   no        yes    yes      yes      4        3     5
## 175        no    yes  yes        yes    yes       no      4        4     5
## 176        no     no  yes        yes    yes       no      4        4     4
## 177        no     no  yes        yes    yes       no      3        4     4
## 178        no     no   no        yes    yes       no      4        3     4
## 179        no    yes   no        yes    yes      yes      4        3     3
## 180        no    yes   no        yes    yes      yes      5        2     3
## 181        no    yes  yes        yes    yes       no      3        4     3
## 182        no     no  yes        yes    yes      yes      4        2     3
## 183        no     no  yes        yes    yes      yes      4        2     3
## 184        no    yes   no        yes    yes       no      5        4     2
## 185        no    yes   no        yes    yes      yes      5        3     3
## 186        no    yes  yes         no    yes       no      1        2     2
## 187        no    yes   no        yes    yes      yes      4        3     4
## 188        no    yes  yes        yes    yes      yes      3        3     3
## 189        no     no  yes        yes    yes      yes      4        2     3
## 190        no    yes   no         no    yes      yes      3        3     3
## 191        no     no   no         no    yes       no      3        1     3
## 192        no     no   no         no    yes       no      4        3     3
## 193        no     no   no        yes    yes       no      5        3     3
## 194        no     no  yes        yes    yes       no      4        4     4
## 195        no    yes   no        yes    yes       no      4        3     2
## 196        no     no   no         no    yes       no      5        3     3
## 197        no     no   no        yes    yes      yes      4        3     2
## 198        no     no   no         no    yes       no      5        2     3
## 199        no    yes  yes        yes    yes       no      3        3     4
## 200        no    yes   no         no    yes       no      4        2     4
## 201        no    yes  yes         no    yes       no      4        5     2
## 202        no    yes   no        yes    yes       no      4        3     5
## 203       yes    yes  yes        yes    yes       no      4        4     3
## 204        no    yes  yes         no    yes       no      4        4     4
## 205        no    yes   no         no    yes       no      5        3     2
## 206        no    yes  yes        yes    yes       no      5        3     5
## 207        no    yes  yes         no    yes      yes      4        4     3
## 208        no    yes  yes         no    yes       no      2        3     3
## 209        no     no  yes        yes    yes      yes      1        3     2
## 210        no    yes  yes         no    yes       no      4        3     2
## 211        no    yes  yes        yes    yes      yes      4        4     2
## 212        no    yes  yes        yes    yes       no      4        3     3
## 213        no    yes  yes         no    yes      yes      5        3     5
## 214       yes    yes  yes         no    yes       no      3        3     4
## 215        no    yes  yes        yes    yes       no      4        4     4
## 216        no    yes  yes         no    yes       no      5        2     1
## 217        no     no  yes         no    yes       no      4        4     4
## 218        no     no  yes         no    yes      yes      3        4     5
## 219        no    yes  yes         no    yes       no      3        2     4
## 220        no    yes  yes         no    yes       no      3        3     3
## 221        no    yes  yes        yes    yes       no      4        3     3
## 222        no    yes   no        yes    yes       no      4        2     5
## 223        no    yes   no        yes    yes      yes      4        3     4
## 224       yes     no   no         no    yes       no      2        3     1
## 225        no    yes  yes         no    yes       no      3        3     3
## 226        no    yes   no        yes    yes       no      5        3     2
## 227        no     no   no        yes    yes      yes      5        3     3
## 228        no     no   no        yes    yes       no      5        3     4
## 229        no    yes  yes         no    yes       no      5        3     3
## 230       yes    yes  yes        yes    yes      yes      4        3     2
## 231        no     no   no        yes    yes      yes      3        2     3
## 232        no     no   no        yes    yes      yes      3        2     3
## 233        no    yes  yes        yes    yes       no      4        5     2
## 234       yes    yes   no        yes    yes      yes      4        5     5
## 235        no    yes  yes        yes    yes       no      4        2     4
## 236        no    yes  yes         no    yes       no      3        4     2
## 237        no     no   no        yes    yes      yes      5        3     3
## 238        no     no  yes        yes    yes      yes      4        4     2
## 239        no     no   no         no    yes      yes      4        5     2
## 240        no     no   no        yes    yes       no      2        1     1
## 241        no     no   no         no     no       no      5        5     4
## 242        no     no   no        yes    yes      yes      2        5     5
## 243        no    yes  yes         no    yes       no      3        3     3
## 244        no     no   no        yes    yes       no      5        4     5
## 245        no     no   no        yes    yes       no      5        3     2
## 246        no     no   no        yes    yes       no      5        3     2
## 247        no    yes  yes         no    yes      yes      4        4     4
## 248        no     no   no         no    yes       no      4        3     3
## 249        no     no   no         no    yes       no      5        2     2
## 250        no     no   no         no     no      yes      5        4     5
## 251        no    yes   no         no    yes      yes      4        3     3
## 252        no     no  yes         no    yes       no      4        3     2
## 253        no     no   no         no     no       no      4        4     5
## 254       yes    yes   no         no    yes       no      5        3     3
## 255        no     no   no         no     no       no      3        2     5
## 256        no     no   no        yes    yes       no      3        3     2
## 257        no     no   no         no    yes       no      4        4     2
## 258        no    yes   no        yes    yes       no      4        4     4
## 259        no    yes  yes        yes    yes       no      4        2     3
## 260        no    yes   no         no    yes       no      4        3     1
## 261        no     no   no        yes    yes       no      5        2     4
## 262        no     no  yes        yes    yes      yes      3        4     1
## 263        no    yes  yes         no    yes      yes      3        1     2
## 264        no    yes  yes         no    yes       no      4        3     2
## 265        no     no   no        yes    yes       no      5        3     2
## 266        no     no   no        yes    yes       no      3        2     3
## 267        no    yes  yes        yes    yes      yes      4        3     3
## 268        no    yes  yes        yes    yes       no      4        2     5
## 269        no     no  yes        yes    yes      yes      5        4     4
## 270        no     no  yes        yes    yes       no      4        3     4
## 271        no    yes  yes        yes    yes      yes      5        4     5
## 272        no    yes   no         no     no      yes      4        3     5
## 273        no    yes  yes        yes    yes       no      4        3     5
## 274        no    yes  yes        yes    yes      yes      4        5     5
## 275        no    yes  yes         no    yes       no      4        4     3
## 276        no    yes  yes        yes    yes      yes      3        5     2
## 277        no    yes  yes         no    yes      yes      4        3     3
## 278       yes    yes  yes         no    yes      yes      4        4     4
## 279        no     no   no         no     no      yes      4        1     1
## 280        no     no  yes        yes    yes       no      3        2     4
## 281        no     no  yes        yes    yes       no      4        2     4
## 282       yes    yes   no        yes    yes      yes      2        4     4
## 283        no     no  yes        yes    yes       no      4        2     3
## 284        no     no  yes        yes    yes      yes      4        5     4
## 285        no     no   no         no    yes       no      4        4     4
## 286        no    yes  yes        yes    yes       no      5        2     2
## 287       yes     no   no        yes    yes       no      5        4     4
## 288       yes     no   no        yes    yes       no      4        4     4
## 289        no    yes   no         no    yes       no      5        4     5
## 290        no     no  yes         no    yes       no      4        3     3
## 291        no    yes  yes         no    yes       no      4        3     3
## 292        no    yes  yes         no    yes       no      4        3     3
## 293        no     no  yes        yes    yes       no      4        2     4
## 294        no    yes  yes        yes    yes       no      5        4     3
## 295        no    yes  yes        yes    yes      yes      4        3     2
## 296        no    yes  yes         no    yes       no      4        2     2
## 297        no    yes  yes         no    yes       no      3        1     2
## 298        no    yes  yes        yes    yes       no      5        4     2
## 299        no    yes  yes         no    yes       no      4        4     3
## 300        no    yes  yes        yes    yes       no      2        3     4
## 301        no    yes  yes         no    yes      yes      4        4     5
## 302        no    yes  yes         no    yes       no      4        3     3
## 303        no    yes  yes         no    yes      yes      1        4     2
## 304        no    yes   no         no    yes      yes      4        2     4
## 305        no     no  yes         no    yes       no      4        1     1
## 306        no    yes  yes         no    yes       no      4        3     3
## 307        no    yes  yes        yes    yes       no      5        2     2
## 308        no     no   no        yes    yes       no      5        5     3
## 309        no     no   no        yes    yes      yes      4        5     3
## 310        no    yes  yes        yes    yes       no      5        3     3
## 311        no    yes  yes        yes    yes      yes      4        3     4
## 312        no    yes  yes        yes    yes       no      4        3     4
## 313        no    yes  yes         no    yes       no      4        4     4
## 314        no    yes  yes         no    yes      yes      5        2     2
## 315        no    yes   no         no    yes      yes      4        2     2
## 316        no    yes  yes        yes    yes       no      3        3     2
## 317        no    yes   no         no    yes       no      3        4     3
## 318        no     no   no         no    yes       no      3        3     3
## 319        no     no   no        yes    yes       no      4        3     3
## 320        no     no   no        yes    yes       no      4        3     5
## 321        no    yes   no         no    yes       no      4        4     5
## 322        no    yes  yes        yes    yes       no      5        4     2
## 323        no    yes  yes        yes    yes       no      5        4     4
## 324        no    yes  yes         no    yes      yes      4        3     3
## 325        no    yes   no        yes    yes       no      4        5     5
## 326        no    yes   no         no    yes      yes      4        4     3
## 327        no     no   no        yes    yes       no      5        3     4
## 328        no     no   no        yes    yes      yes      4        3     3
## 329        no     no   no        yes    yes       no      4        4     4
## 330        no     no   no         no    yes       no      4        4     5
## 331        no    yes  yes         no    yes      yes      4        3     2
## 332        no    yes   no         no    yes       no      5        3     3
## 333        no    yes  yes         no    yes       no      4        3     3
## 334        no    yes   no        yes    yes       no      4        2     4
## 335        no    yes   no        yes    yes       no      4        3     3
## 336        no     no   no        yes    yes      yes      4        3     3
## 337        no    yes   no         no    yes      yes      3        3     1
## 338        no    yes   no         no    yes       no      4        3     3
## 339        no     no   no         no    yes      yes      5        4     3
## 340        no     no   no         no    yes      yes      5        3     2
## 341        no    yes  yes         no    yes      yes      5        4     5
## 342        no    yes  yes        yes    yes      yes      4        4     3
## 343        no    yes   no         no    yes       no      2        5     5
## 344        no     no   no         no    yes       no      5        4     4
## 345        no    yes  yes         no    yes       no      4        5     4
## 346        no     no   no         no     no      yes      4        3     3
## 347        no    yes   no         no    yes       no      4        4     4
## 348        no    yes  yes        yes    yes      yes      4        5     5
## 349        no    yes   no         no    yes      yes      5        3     4
## 350        no    yes  yes        yes    yes       no      4        3     3
## 351        no     no   no         no    yes      yes      1        2     3
## 352        no     no   no         no    yes      yes      3        3     2
## 353        no     no   no         no    yes       no      5        3     2
## 354        no    yes   no         no    yes      yes      4        3     2
## 355        no    yes  yes        yes    yes      yes      2        3     4
## 356        no     no   no         no    yes       no      3        2     2
## 357        no    yes  yes         no    yes       no      3        3     4
## 358        no     no  yes         no    yes      yes      4        2     2
## 359        no    yes  yes         no    yes      yes      5        2     1
## 360        no    yes  yes         no    yes      yes      5        2     3
## 361        no    yes  yes         no    yes      yes      3        2     2
## 362        no    yes  yes        yes     no      yes      4        3     3
## 363        no     no   no        yes    yes      yes      3        4     3
## 364        no     no   no        yes    yes       no      3        5     5
## 365        no     no   no         no    yes       no      5        4     4
## 366        no     no   no         no    yes       no      4        3     2
## 367        no     no  yes        yes    yes       no      5        4     3
## 368        no     no  yes         no    yes      yes      4        1     3
## 369        no    yes  yes        yes    yes       no      4        5     4
## 370        no     no  yes        yes    yes       no      3        2     4
## 371        no     no   no        yes    yes      yes      4        4     3
## 372        no     no   no        yes    yes       no      4        4     3
## 373        no     no   no         no    yes       no      4        3     2
## 374        no     no  yes         no    yes       no      5        4     3
## 375        no     no  yes         no    yes       no      5        3     3
## 376        no    yes  yes        yes    yes      yes      4        4     3
## 377        no     no   no        yes    yes       no      5        4     2
## 378        no    yes  yes         no    yes       no      4        3     4
## 379        no     no   no        yes    yes       no      2        2     2
## 380        no     no   no        yes    yes       no      1        1     1
## 381        no     no   no         no    yes       no      2        4     5
## 382        no     no   no         no    yes       no      4        4     1
##     Dalc Walc health absences G1 G2 G3 alc_use high_use
## 1      1    1      3        5  2  8  8     1.0    FALSE
## 2      1    1      3        3  7  8  8     1.0    FALSE
## 3      2    3      3        8 10 10 11     2.5     TRUE
## 4      1    1      5        1 14 14 14     1.0    FALSE
## 5      1    2      5        2  8 12 12     1.5    FALSE
## 6      1    2      5        8 14 14 14     1.5    FALSE
## 7      1    1      3        0 12 12 12     1.0    FALSE
## 8      1    1      1        4  8  9 10     1.0    FALSE
## 9      1    1      1        0 16 17 18     1.0    FALSE
## 10     1    1      5        0 13 14 14     1.0    FALSE
## 11     1    2      2        1 12 11 12     1.5    FALSE
## 12     1    1      4        2 10 12 12     1.0    FALSE
## 13     1    3      5        1 13 14 13     2.0    FALSE
## 14     1    2      3        1 11 11 12     1.5    FALSE
## 15     1    1      3        0 14 15 16     1.0    FALSE
## 16     1    2      2        5 16 16 16     1.5    FALSE
## 17     1    2      2        8 13 14 14     1.5    FALSE
## 18     1    1      4        3 10 12 12     1.0    FALSE
## 19     2    4      5        9  7  6  6     3.0     TRUE
## 20     1    3      5        5 10 11 11     2.0    FALSE
## 21     1    1      1        0 12 14 14     1.0    FALSE
## 22     1    1      5        0 12 14 14     1.0    FALSE
## 23     1    3      5        1 14 14 15     2.0    FALSE
## 24     2    4      5        1 12 12 11     3.0     TRUE
## 25     1    1      5        2 10 10  9     1.0    FALSE
## 26     1    3      5       10  8 10 10     2.0    FALSE
## 27     1    2      5        5 12 12 12     1.5    FALSE
## 28     2    4      1        2 13 14 13     3.0     TRUE
## 29     1    1      5        3 12 12 12     1.0    FALSE
## 30     5    5      5       10 11 12 12     5.0     TRUE
## 31     3    4      5        0 10 11 12     3.5     TRUE
## 32     1    1      5        1 16 16 16     1.0    FALSE
## 33     1    1      5        0 15 15 16     1.0    FALSE
## 34     1    1      2        0 10 11 12     1.0    FALSE
## 35     1    1      5        2 12 13 14     1.0    FALSE
## 36     1    1      5        2 10  9  8     1.0    FALSE
## 37     1    1      4        1 14 15 16     1.0    FALSE
## 38     1    1      5        6 14 14 14     1.0    FALSE
## 39     1    1      5        2 12 12 12     1.0    FALSE
## 40     1    1      2        8 14 13 12     1.0    FALSE
## 41     1    2      3       20  9 10 10     1.5    FALSE
## 42     2    4      5        8 11 12 12     3.0     TRUE
## 43     1    1      5        1 16 16 16     1.0    FALSE
## 44     1    1      1        0  8  9 10     1.0    FALSE
## 45     2    2      5       14 10 10 10     2.0    FALSE
## 46     1    1      5        6  9 10  8     1.0    FALSE
## 47     1    4      3        9 12 12 12     2.5     TRUE
## 48     1    1      2        3 18 18 18     1.0    FALSE
## 49     2    2      5        3 13 14 14     2.0    FALSE
## 50     1    1      3        2 10 10 10     1.0    FALSE
## 51     2    3      4        1 13 13 13     2.5     TRUE
## 52     1    1      5        1 14 14 14     1.0    FALSE
## 53     3    4      5        5 10 10 10     3.5     TRUE
## 54     2    3      5        0 10 11 12     2.5     TRUE
## 55     4    4      1        3 12 12 13     4.0     TRUE
## 56     1    1      2        5 10 11 11     1.0    FALSE
## 57     1    1      1        0 14 14 15     1.0    FALSE
## 58     1    1      5        6 14 15 16     1.0    FALSE
## 59     1    1      5        1 12 12 12     1.0    FALSE
## 60     1    1      5        2 16 16 16     1.0    FALSE
## 61     2    3      4        3 14 14 14     2.5     TRUE
## 62     5    5      5        3 10  9 14     5.0     TRUE
## 63     1    1      1        2 10 12 10     1.0    FALSE
## 64     2    4      4        1 12 11 11     3.0     TRUE
## 65     2    4      2        0 12 11 11     3.0     TRUE
## 66     1    2      1        2 16 15 16     1.5    FALSE
## 67     5    5      3        2 12 12 12     5.0     TRUE
## 68     1    2      5        2  8  8  8     1.5    FALSE
## 69     1    3      4        1 10 10 10     2.0    FALSE
## 70     2    3      3        9 16 16 16     2.5     TRUE
## 71     1    1      5        1 13 13 13     1.0    FALSE
## 72     1    1      3        0 10 10 10     1.0    FALSE
## 73     2    4      5        2 10  8  8     3.0     TRUE
## 74     2    2      5        1 12 12 14     2.0    FALSE
## 75     2    4      5       29 11 12 11     3.0     TRUE
## 76     2    3      5        3 10 10 10     2.5     TRUE
## 77     1    1      1        4 12 11 10     1.0    FALSE
## 78     1    3      3        0 12 12 12     2.0    FALSE
## 79     1    1      3        1  8  8 10     1.0    FALSE
## 80     1    2      4       12  8  8  8     1.5    FALSE
## 81     1    2      3       13  8  8  8     1.5    FALSE
## 82     1    3      3        1 10 12 12     2.0    FALSE
## 83     1    2      5        3 10 10 10     1.5    FALSE
## 84     1    1      5        7 10  8  8     1.0    FALSE
## 85     1    3      4        3 14 14 14     2.0    FALSE
## 86     2    3      4        2 11 11 11     2.5     TRUE
## 87     2    3      5        5 10 10 10     2.5     TRUE
## 88     1    2      2        5 10  9  8     1.5    FALSE
## 89     1    3      1        4 14 14 14     2.0    FALSE
## 90     1    1      3        9 12 10 10     1.0    FALSE
## 91     3    5      5       12  8  8  8     4.0     TRUE
## 92     1    3      4        1  8  9 10     2.0    FALSE
## 93     1    3      1        5 15 15 16     2.0    FALSE
## 94     2    3      2        2 10 10  9     2.5     TRUE
## 95     1    1      1        1 12 12 12     1.0    FALSE
## 96     1    1      4        4 11 12 13     1.0    FALSE
## 97     1    1      1        3 10 12 12     1.0    FALSE
## 98     1    1      4        4 10 13 13     1.0    FALSE
## 99     1    1      5        1 10 10 11     1.0    FALSE
## 100    1    2      1        5 12 14 14     1.5    FALSE
## 101    1    1      3        1 10 11 10     1.0    FALSE
## 102    5    5      4       13  8  8  6     5.0     TRUE
## 103    1    1      4        0 16 16 16     1.0    FALSE
## 104    1    1      5        3 11 13 13     1.0    FALSE
## 105    1    1      2       21  9  8  8     1.0    FALSE
## 106    1    1      1        0 16 17 17     1.0    FALSE
## 107    1    1      4       10 10 10 10     1.0    FALSE
## 108    1    1      3        6  8  9  9     1.0    FALSE
## 109    1    1      5        3 14 16 16     1.0    FALSE
## 110    1    2      4        1 14 15 16     1.5    FALSE
## 111    3    5      1        7 11 12 12     4.0     TRUE
## 112    1    1      4        3 14 15 15     1.0    FALSE
## 113    1    1      4        5 16 16 16     1.0    FALSE
## 114    1    1      2        2  9 10 10     1.0    FALSE
## 115    1    1      5        9  9 12 12     1.0    FALSE
## 116    1    1      3       10 18 18 18     1.0    FALSE
## 117    1    1      5        6 10  9 10     1.0    FALSE
## 118    1    2      5        4 16 14 15     1.5    FALSE
## 119    2    2      5        9 12 12 12     2.0    FALSE
## 120    1    1      2        3 14 14 15     1.0    FALSE
## 121    1    1      5        3 14 14 14     1.0    FALSE
## 122    1    4      5       17 10  9 10     2.5     TRUE
## 123    1    2      4        4 14 13 14     1.5    FALSE
## 124    1    2      1        1 15 14 14     1.5    FALSE
## 125    1    2      5        6 15 14 14     1.5    FALSE
## 126    1    2      5        2 14 12 13     1.5    FALSE
## 127    1    4      5       11 13 12 13     2.5     TRUE
## 128    1    1      5        0 10  9 10     1.0    FALSE
## 129    3    2      5        1 11 11 10     2.5     TRUE
## 130    1    1      1        0  8 10 11     1.0    FALSE
## 131    1    1      5        1  8  9 10     1.0    FALSE
## 132    2    5      4        8 16 16 16     3.5     TRUE
## 133    2    2      5        0 11  6  6     2.0    FALSE
## 134    1    2      4        3 10  6  6     1.5    FALSE
## 135    1    3      5        7 12 12 12     2.0    FALSE
## 136    1    4      5       14 14 12 12     2.5     TRUE
## 137    1    1      5        1 10  6  6     1.0    FALSE
## 138    1    1      5        2 12  7  8     1.0    FALSE
## 139    2    4      5        1 10  4  5     3.0     TRUE
## 140    1    1      5        2  6  4  5     1.0    FALSE
## 141    1    3      5        0 12 11 11     2.0    FALSE
## 142    1    1      5        3 14 15 14     1.0    FALSE
## 143    1    1      3        3  8 10  6     1.0    FALSE
## 144    2    2      2        6 10 10 10     2.0    FALSE
## 145    1    1      5        2 11 12 12     1.0    FALSE
## 146    3    3      1        3 12 12 12     3.0     TRUE
## 147    1    2      4        0  7  4  5     1.5    FALSE
## 148    1    2      5       11  7  4  3     1.5    FALSE
## 149    1    2      5        0 10 12 12     1.5    FALSE
## 150    1    1      3        1  8  9  6     1.0    FALSE
## 151    1    1      5        4 12 12 12     1.0    FALSE
## 152    2    2      5        3 12 10  7     2.0    FALSE
## 153    2    1      5        8  8  8  4     1.5    FALSE
## 154    2    5      5        0 10 10 10     3.5     TRUE
## 155    2    5      4        0  8  7  0     3.5     TRUE
## 156    3    5      5        6 10 12 12     4.0     TRUE
## 157    2    3      3        5 12 12 12     2.5     TRUE
## 158    1    1      4        3  8  4  6     1.0    FALSE
## 159    1    1      4        0 12 12 12     1.0    FALSE
## 160    1    1      1        1  9  8  8     1.0    FALSE
## 161    3    3      5       11 12 10 12     3.0     TRUE
## 162    1    5      4        6 10  9 10     3.0     TRUE
## 163    1    2      3        3 14 12 13     1.5    FALSE
## 164    4    4      5        2 10 11  6     4.0     TRUE
## 165    2    2      5        4  8  7  4     2.0    FALSE
## 166    1    5      5        0  6  8  8     3.0     TRUE
## 167    2    4      4        2 10 10 10     3.0     TRUE
## 168    1    1      3        0 16 16 17     1.0    FALSE
## 169    1    1      4        0  9 10  6     1.0    FALSE
## 170    1    1      3        0 15 15 16     1.0    FALSE
## 171    2    4      2        2  8  7  5     3.0     TRUE
## 172    1    1      3        1 14 16 17     1.0    FALSE
## 173    1    3      5        0 12 10 10     2.0    FALSE
## 174    1    1      3        0 11 10  6     1.0    FALSE
## 175    1    1      4        2 12 12 12     1.0    FALSE
## 176    4    4      4        2 10 10 10     4.0     TRUE
## 177    1    4      5        1 13 12 12     2.5     TRUE
## 178    1    4      4        4  8  7  8     2.5     TRUE
## 179    3    4      3        9 10  8 10     3.5     TRUE
## 180    1    1      2        4 10 10 12     1.0    FALSE
## 181    2    3      3        7 10  9 10     2.5     TRUE
## 182    1    2      4        3 12 14 13     1.5    FALSE
## 183    1    2      3        1 12 12 12     1.5    FALSE
## 184    2    3      5        0 16 18 17     2.5     TRUE
## 185    2    3      1       44 12 11 11     2.5     TRUE
## 186    1    2      1       11 13 14 14     1.5    FALSE
## 187    2    3      4        9 12 12 12     2.5     TRUE
## 188    1    2      3        1 10 10 11     1.5    FALSE
## 189    1    2      5        0 14 14 16     1.5    FALSE
## 190    1    3      3        8 10 10 12     2.0    FALSE
## 191    1    5      3        5  8  9 10     3.0     TRUE
## 192    1    1      2        8 12 12 13     1.0    FALSE
## 193    1    1      3        0 10 10 10     1.0    FALSE
## 194    4    5      5       14  8 10 10     4.5     TRUE
## 195    3    4      5        4 10 10 10     3.5     TRUE
## 196    1    1      3        0 13 13 13     1.0    FALSE
## 197    1    1      5        4 14 15 16     1.0    FALSE
## 198    1    2      5        4 15 14 15     1.5    FALSE
## 199    3    5      3       12 10 10 11     4.0     TRUE
## 200    2    3      2       27 16 16 17     2.5     TRUE
## 201    1    2      3        0 10 10 10     1.5    FALSE
## 202    1    5      2        2 15 15 16     3.0     TRUE
## 203    1    3      4        5 10 11 11     2.0    FALSE
## 204    1    3      1        2 12 12 12     2.0    FALSE
## 205    1    2      3       20 10 10 10     1.5    FALSE
## 206    1    1      5        6 12 12 12     1.0    FALSE
## 207    3    4      5       21  9  9  8     3.5     TRUE
## 208    2    2      4        4  9  9 10     2.0    FALSE
## 209    1    1      1        7 12 14 14     1.0    FALSE
## 210    1    4      5        4 10 11 12     2.5     TRUE
## 211    1    1      4        3  9 10 10     1.0    FALSE
## 212    1    2      3        7 10 10 10     1.5    FALSE
## 213    4    5      3       14 12 12 12     4.5     TRUE
## 214    1    1      4        0 12 13 14     1.0    FALSE
## 215    2    4      5       12  9  9 10     3.0     TRUE
## 216    1    2      3        9 10 10 10     1.5    FALSE
## 217    1    3      1        2 14 16 15     2.0    FALSE
## 218    2    4      1       19  8  8  7     3.0     TRUE
## 219    2    4      4       12  8  8  9     3.0     TRUE
## 220    1    4      3        4 10 10 10     2.5     TRUE
## 221    1    1      4        2 10 11 12     1.0    FALSE
## 222    1    2      5        1  8  8  8     1.5    FALSE
## 223    1    1      5        6  9  8  6     1.0    FALSE
## 224    1    1      3        1 14 14 16     1.0    FALSE
## 225    5    5      4        4 11 11 12     5.0     TRUE
## 226    1    1      5        2 14 14 15     1.0    FALSE
## 227    1    1      4       10  8  8  8     1.0    FALSE
## 228    1    3      3        6 16 16 16     2.0    FALSE
## 229    1    3      3        1 11 11 12     2.0    FALSE
## 230    4    5      3        8 10  9 10     4.5     TRUE
## 231    1    2      3        5 14 12 14     1.5    FALSE
## 232    1    2      3        7 14 12 13     1.5    FALSE
## 233    1    1      1        2 12 12 12     1.0    FALSE
## 234    1    3      2        7 12 11 11     2.0    FALSE
## 235    2    4      1        1 14 13 14     3.0     TRUE
## 236    1    1      5       10  9  8  8     1.0    FALSE
## 237    1    3      2        5 12 10 11     2.0    FALSE
## 238    5    5      4        2 15 14 14     5.0     TRUE
## 239    1    1      5       12 11 11 11     1.0    FALSE
## 240    1    1      3        2 13 12 12     1.0    FALSE
## 241    3    5      2        8  8  7  4     4.0     TRUE
## 242    1    4      5       11 14 14 14     2.5     TRUE
## 243    2    3      4        1 11 12 12     2.5     TRUE
## 244    1    1      3        4 10  7  8     1.0    FALSE
## 245    1    2      5        0 14 12 12     1.5    FALSE
## 246    1    2      5        2 14 14 14     1.5    FALSE
## 247    1    1      3        5 10  5  6     1.0    FALSE
## 248    1    1      4        6 16 17 17     1.0    FALSE
## 249    1    1      2        3 10 12 13     1.0    FALSE
## 250    5    5      1       14  6  8  6     5.0     TRUE
## 251    1    3      5        8  6  7  8     2.0    FALSE
## 252    2    4      5        0 12 14 13     3.0     TRUE
## 253    2    4      5        4  6  8  8     3.0     TRUE
## 254    1    3      2        5  8 10 10     2.0    FALSE
## 255    2    5      5        4  6  8  7     3.5     TRUE
## 256    1    3      3        1 11 11 10     2.0    FALSE
## 257    2    4      5        0 10 12 12     3.0     TRUE
## 258    1    2      5        1  8 10  9     1.5    FALSE
## 259    1    1      4        4 14 14 15     1.0    FALSE
## 260    1    1      1        8 11 12 12     1.0    FALSE
## 261    1    2      4        5 16 15 15     1.5    FALSE
## 262    1    1      2        1 10 10  6     1.0    FALSE
## 263    1    3      2       12 16 16 16     2.0    FALSE
## 264    1    1      3        2  9  9 10     1.0    FALSE
## 265    1    1      3        2 12 12 12     1.0    FALSE
## 266    1    1      4        3 12 10 11     1.0    FALSE
## 267    1    1      3        0 10 11  6     1.0    FALSE
## 268    3    4      1       10 16 16 16     3.5     TRUE
## 269    3    4      5        1 10 10 12     3.5     TRUE
## 270    2    2      4        8 11 10 12     2.0    FALSE
## 271    1    3      5        7 10 10 12     2.0    FALSE
## 272    1    2      3        6  7  4  5     1.5    FALSE
## 273    3    3      5       16 10 10 10     3.0     TRUE
## 274    1    3      2        7 16 15 15     2.0    FALSE
## 275    1    1      3        2 12 12 12     1.0    FALSE
## 276    2    2      1        2 16 16 16     2.0    FALSE
## 277    1    1      1        4 12 13 13     1.0    FALSE
## 278    2    3      5        6 12 12 12     2.5     TRUE
## 279    1    1      5       45 11  9 10     1.0    FALSE
## 280    1    4      3       14 10 10 10     2.5     TRUE
## 281    2    3      2       11 10 10 11     2.5     TRUE
## 282    1    1      4        8 12 10 10     1.0    FALSE
## 283    1    2      1        4 10 10 10     1.5    FALSE
## 284    2    4      5       26 10 10  9     3.0     TRUE
## 285    3    4      3       18 12 11 12     3.5     TRUE
## 286    1    1      3        2 14 14 15     1.0    FALSE
## 287    1    1      4        2 10 11 12     1.0    FALSE
## 288    1    2      3        2 11 12 12     1.5    FALSE
## 289    1    2      5        8 11 10 12     1.5    FALSE
## 290    1    2      4        1 12 11 12     1.5    FALSE
## 291    1    2      2        2 18 18 18     1.5    FALSE
## 292    1    1      3        3 13 12 13     1.0    FALSE
## 293    1    3      2        3 14 14 14     2.0    FALSE
## 294    1    1      2        4 16 15 16     1.0    FALSE
## 295    1    4      5        6 14 14 14     2.5     TRUE
## 296    1    2      3        0 16 16 16     1.5    FALSE
## 297    1    1      3        3 18 18 18     1.0    FALSE
## 298    1    1      4        4 14 14 14     1.0    FALSE
## 299    1    3      5        2 14 14 13     2.0    FALSE
## 300    2    3      2        1 12 11  6     2.5     TRUE
## 301    1    2      2        5 12 11 11     1.5    FALSE
## 302    1    1      3        0 15 15 16     1.0    FALSE
## 303    2    2      1        2 17 16 16     2.0    FALSE
## 304    1    1      4        7 13 12 13     1.0    FALSE
## 305    2    2      5        0 12 12 12     2.0    FALSE
## 306    1    1      3        0 16 14 15     1.0    FALSE
## 307    1    2      5        0 18 18 18     1.5    FALSE
## 308    1    1      5        0 16 16 16     1.0    FALSE
## 309    1    2      5        0 12 11 12     1.5    FALSE
## 310    1    2      1        1 10 10  8     1.5    FALSE
## 311    1    1      5        6 12 12 13     1.0    FALSE
## 312    2    5      5        1 13 13 14     3.5     TRUE
## 313    3    3      5        1 12 11 12     3.0     TRUE
## 314    1    2      5       18 14 14 15     1.5    FALSE
## 315    1    1      3        8 12 11 11     1.0    FALSE
## 316    2    2      3        2 11 11 10     2.0    FALSE
## 317    2    3      5        0 14 16 16     2.5     TRUE
## 318    2    3      2        0 15 14 15     2.5     TRUE
## 319    2    2      3        2 11 13 12     2.0    FALSE
## 320    3    5      5        2 16 16 16     4.0     TRUE
## 321    5    5      4        5 11 10 10     5.0     TRUE
## 322    1    4      4        4 10 10 10     2.5     TRUE
## 323    1    3      4        4 12 10 11     2.0    FALSE
## 324    1    2      4        4 14 14 14     1.5    FALSE
## 325    2    4      5        1 10 10 10     3.0     TRUE
## 326    1    1      5        4 14 14 14     1.0    FALSE
## 327    1    1      4        4  8  6  6     1.0    FALSE
## 328    1    1      2        0  9  8  6     1.0    FALSE
## 329    1    1      4        3 12 11  7     1.0    FALSE
## 330    1    3      5       12 14 14 14     2.0    FALSE
## 331    2    3      2        0 10 10  8     2.5     TRUE
## 332    1    1      1        6 15 14 16     1.0    FALSE
## 333    2    3      2        2 12 12 13     2.5     TRUE
## 334    2    3      2        3 10 11  6     2.5     TRUE
## 335    2    2      2        0 11 11  6     2.0    FALSE
## 336    1    3      5        8 16 16 16     2.0    FALSE
## 337    1    2      4        9 10 10  7     1.5    FALSE
## 338    1    2      3        2 11 11 12     1.5    FALSE
## 339    2    3      1        6 14 14 16     2.5     TRUE
## 340    1    2      4        6 16 14 16     1.5    FALSE
## 341    2    3      5        0 12 12 12     2.5     TRUE
## 342    1    3      4        0 12 14 14     2.0    FALSE
## 343    5    5      5        9 10 12 12     5.0     TRUE
## 344    3    3      2        8  9  8 10     3.0     TRUE
## 345    2    3      3        3 10 11 12     2.5     TRUE
## 346    2    3      3        4  8  8  8     2.5     TRUE
## 347    3    3      5        4  8  8  9     3.0     TRUE
## 348    1    3      2        4 12 11 11     2.0    FALSE
## 349    1    1      5        0 10 10 10     1.0    FALSE
## 350    1    2      5        3 12 12 12     1.5    FALSE
## 351    1    2      5        1 14 13 13     1.5    FALSE
## 352    1    2      3        3 12 12 12     1.5    FALSE
## 353    1    1      4        0 18 16 17     1.0    FALSE
## 354    1    3      3        3 12 12 12     2.0    FALSE
## 355    1    1      1        2 16 14 15     1.0    FALSE
## 356    1    2      3        0 12 12 12     1.5    FALSE
## 357    2    4      3        2  9 10 10     3.0     TRUE
## 358    2    2      5        0 14 14 14     2.0    FALSE
## 359    1    2      1        0  8  7  4     1.5    FALSE
## 360    1    2      4        0 10 10 10     1.5    FALSE
## 361    4    2      5        5 10  8  6     3.0     TRUE
## 362    2    3      3        3 12 11 11     2.5     TRUE
## 363    1    1      3        8 12 11 12     1.0    FALSE
## 364    1    3      1        9  6  6  7     2.0    FALSE
## 365    1    1      1        0 17 18 18     1.0    FALSE
## 366    1    2      4        3  9 10 11     1.5    FALSE
## 367    3    4      2        2 10 12 12     3.5     TRUE
## 368    1    2      1        0 16 16 16     1.5    FALSE
## 369    2    3      1       14  9 10 10     2.5     TRUE
## 370    1    4      2        4 16 16 16     2.5     TRUE
## 371    1    3      5        2  7  6  4     2.0    FALSE
## 372    1    1      3        3 12 13 13     1.0    FALSE
## 373    1    3      5        0  6  6  0     2.0    FALSE
## 374    4    3      3        7  6  6  2     3.5     TRUE
## 375    1    3      4        1 12 13 12     2.0    FALSE
## 376    2    2      5        6  6  7  8     2.0    FALSE
## 377    1    2      5        2  8  8  5     1.5    FALSE
## 378    1    1      1        2 11 12 12     1.0    FALSE
## 379    2    2      5        2  6  6  4     2.0    FALSE
## 380    1    1      5        3  8  8  4     1.0    FALSE
## 381    3    4      2        4 12 13 13     3.5     TRUE
## 382    3    4      5        2 10 12 10     3.5     TRUE

The data wrangling exercise combined the two student alcohol consumption data sets. Variables not used for joining the two data have been combined by averaging (including the grade variables) - ‘alc_use’ is the average of ‘Dalc’ and ‘Walc’ - ‘high_use’ is TRUE if ‘alc_use’ is higher than 2 and FALSE otherwise

3.3 Analysis of the data

3.3.1 start by viewing the variable names, example of the first rows in the data, summary of the overall data

##  [1] "X"          "school"     "sex"        "age"        "address"   
##  [6] "famsize"    "Pstatus"    "Medu"       "Fedu"       "Mjob"      
## [11] "Fjob"       "reason"     "nursery"    "internet"   "guardian"  
## [16] "traveltime" "studytime"  "failures"   "schoolsup"  "famsup"    
## [21] "paid"       "activities" "higher"     "romantic"   "famrel"    
## [26] "freetime"   "goout"      "Dalc"       "Walc"       "health"    
## [31] "absences"   "G1"         "G2"         "G3"         "alc_use"   
## [36] "high_use"
##   X school sex age address famsize Pstatus Medu Fedu     Mjob     Fjob
## 1 1     GP   F  18       U     GT3       A    4    4  at_home  teacher
## 2 2     GP   F  17       U     GT3       T    1    1  at_home    other
## 3 3     GP   F  15       U     LE3       T    1    1  at_home    other
## 4 4     GP   F  15       U     GT3       T    4    2   health services
## 5 5     GP   F  16       U     GT3       T    3    3    other    other
## 6 6     GP   M  16       U     LE3       T    4    3 services    other
##       reason nursery internet guardian traveltime studytime failures
## 1     course     yes       no   mother          2         2        0
## 2     course      no      yes   father          1         2        0
## 3      other     yes      yes   mother          1         2        2
## 4       home     yes      yes   mother          1         3        0
## 5       home     yes       no   father          1         2        0
## 6 reputation     yes      yes   mother          1         2        0
##   schoolsup famsup paid activities higher romantic famrel freetime goout
## 1       yes     no   no         no    yes       no      4        3     4
## 2        no    yes   no         no    yes       no      5        3     3
## 3       yes     no  yes         no    yes       no      4        3     2
## 4        no    yes  yes        yes    yes      yes      3        2     2
## 5        no    yes  yes         no    yes       no      4        3     2
## 6        no    yes  yes        yes    yes       no      5        4     2
##   Dalc Walc health absences G1 G2 G3 alc_use high_use
## 1    1    1      3        5  2  8  8     1.0    FALSE
## 2    1    1      3        3  7  8  8     1.0    FALSE
## 3    2    3      3        8 10 10 11     2.5     TRUE
## 4    1    1      5        1 14 14 14     1.0    FALSE
## 5    1    2      5        2  8 12 12     1.5    FALSE
## 6    1    2      5        8 14 14 14     1.5    FALSE
##        X          school   sex          age        address famsize  
##  Min.   :  1.00   GP:342   F:198   Min.   :15.00   R: 81   GT3:278  
##  1st Qu.: 96.25   MS: 40   M:184   1st Qu.:16.00   U:301   LE3:104  
##  Median :191.50                    Median :17.00                    
##  Mean   :191.50                    Mean   :16.59                    
##  3rd Qu.:286.75                    3rd Qu.:17.00                    
##  Max.   :382.00                    Max.   :22.00                    
##  Pstatus      Medu            Fedu             Mjob           Fjob    
##  A: 38   Min.   :0.000   Min.   :0.000   at_home : 53   at_home : 16  
##  T:344   1st Qu.:2.000   1st Qu.:2.000   health  : 33   health  : 17  
##          Median :3.000   Median :3.000   other   :138   other   :211  
##          Mean   :2.806   Mean   :2.565   services: 96   services:107  
##          3rd Qu.:4.000   3rd Qu.:4.000   teacher : 62   teacher : 31  
##          Max.   :4.000   Max.   :4.000                                
##         reason    nursery   internet    guardian     traveltime   
##  course    :140   no : 72   no : 58   father: 91   Min.   :1.000  
##  home      :110   yes:310   yes:324   mother:275   1st Qu.:1.000  
##  other     : 34                       other : 16   Median :1.000  
##  reputation: 98                                    Mean   :1.448  
##                                                    3rd Qu.:2.000  
##                                                    Max.   :4.000  
##    studytime        failures      schoolsup famsup     paid     activities
##  Min.   :1.000   Min.   :0.0000   no :331   no :144   no :205   no :181   
##  1st Qu.:1.000   1st Qu.:0.0000   yes: 51   yes:238   yes:177   yes:201   
##  Median :2.000   Median :0.0000                                           
##  Mean   :2.037   Mean   :0.2016                                           
##  3rd Qu.:2.000   3rd Qu.:0.0000                                           
##  Max.   :4.000   Max.   :3.0000                                           
##  higher    romantic      famrel         freetime        goout      
##  no : 18   no :261   Min.   :1.000   Min.   :1.00   Min.   :1.000  
##  yes:364   yes:121   1st Qu.:4.000   1st Qu.:3.00   1st Qu.:2.000  
##                      Median :4.000   Median :3.00   Median :3.000  
##                      Mean   :3.937   Mean   :3.22   Mean   :3.113  
##                      3rd Qu.:5.000   3rd Qu.:4.00   3rd Qu.:4.000  
##                      Max.   :5.000   Max.   :5.00   Max.   :5.000  
##       Dalc            Walc           health         absences   
##  Min.   :1.000   Min.   :1.000   Min.   :1.000   Min.   : 0.0  
##  1st Qu.:1.000   1st Qu.:1.000   1st Qu.:3.000   1st Qu.: 1.0  
##  Median :1.000   Median :2.000   Median :4.000   Median : 3.0  
##  Mean   :1.482   Mean   :2.296   Mean   :3.573   Mean   : 4.5  
##  3rd Qu.:2.000   3rd Qu.:3.000   3rd Qu.:5.000   3rd Qu.: 6.0  
##  Max.   :5.000   Max.   :5.000   Max.   :5.000   Max.   :45.0  
##        G1              G2              G3           alc_use     
##  Min.   : 2.00   Min.   : 4.00   Min.   : 0.00   Min.   :1.000  
##  1st Qu.:10.00   1st Qu.:10.00   1st Qu.:10.00   1st Qu.:1.000  
##  Median :12.00   Median :12.00   Median :12.00   Median :1.500  
##  Mean   :11.49   Mean   :11.47   Mean   :11.46   Mean   :1.889  
##  3rd Qu.:14.00   3rd Qu.:14.00   3rd Qu.:14.00   3rd Qu.:2.500  
##  Max.   :18.00   Max.   :18.00   Max.   :18.00   Max.   :5.000  
##   high_use      
##  Mode :logical  
##  FALSE:268      
##  TRUE :114      
##                 
##                 
## 
  • With this overview of the data you can basically just check one by one what are the minimum and maximum values for each variable and also the total number of female and male students in the course.

3.3.2 Another why to inspect the data is to check summaries of the data by groups of variables

## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:GGally':
## 
##     nasa
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## # A tibble: 4 x 4
## # Groups:   sex [?]
##      sex high_use count mean_grade
##   <fctr>    <lgl> <int>      <dbl>
## 1      F    FALSE   156   11.39744
## 2      F     TRUE    42   11.71429
## 3      M    FALSE   112   12.20536
## 4      M     TRUE    72   10.27778

3.3.3 Analyse the relationship between the levels of high alcohol consuption and failure, absences, sex and grades of the students.

One could associate that an increased alcohol consuption will lead to an increase in failures, absences from school and also with a decrease in the final grades (grade form the 3rd period = G3). The differences of alcohol intake amongs sex and age seems also interesting to explore (once there is the stereotyped idea that males drink more and younger students are not leagally allowed to drink).

## 
## Call:
## glm(formula = high_use ~ age + absences + sex + G3, family = "binomial", 
##     data = alc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2729  -0.8326  -0.6292   1.0442   2.1190  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.38339    1.84796  -1.831 0.067120 .  
## age          0.13985    0.10328   1.354 0.175690    
## absences     0.08964    0.02309   3.882 0.000104 ***
## sexM         0.98580    0.24184   4.076 4.58e-05 ***
## G3          -0.06631    0.03624  -1.830 0.067277 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 465.68  on 381  degrees of freedom
## Residual deviance: 423.66  on 377  degrees of freedom
## AIC: 433.66
## 
## Number of Fisher Scoring iterations: 4
## (Intercept)         age    absences        sexM          G3 
## -3.38338833  0.13985344  0.08963638  0.98580237 -0.06630516

failures 0.34596 0.20496 1.688 0.09142 .
absences 0.09135 0.02293 3.983 6.81e-05 sexM 0.95321 0.24278 3.926 8.63e-05 G3

3.4 Inspect numerically and graphically the distributions of the previously chosen variables and their relationship with alcohol consumption

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  382 
## 
##  
##              | alc$age 
## alc$high_use |        15 |        16 |        17 |        18 |        19 |        20 |        22 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##        FALSE |        63 |        79 |        64 |        54 |         7 |         1 |         0 |       268 | 
##              |     0.671 |     0.206 |     0.540 |     0.141 |     0.067 |     0.127 |     0.702 |           | 
##              |     0.235 |     0.295 |     0.239 |     0.201 |     0.026 |     0.004 |     0.000 |     0.702 | 
##              |     0.778 |     0.738 |     0.640 |     0.667 |     0.636 |     1.000 |     0.000 |           | 
##              |     0.165 |     0.207 |     0.168 |     0.141 |     0.018 |     0.003 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##         TRUE |        18 |        28 |        36 |        27 |         4 |         0 |         1 |       114 | 
##              |     1.576 |     0.484 |     1.270 |     0.331 |     0.157 |     0.298 |     1.649 |           | 
##              |     0.158 |     0.246 |     0.316 |     0.237 |     0.035 |     0.000 |     0.009 |     0.298 | 
##              |     0.222 |     0.262 |     0.360 |     0.333 |     0.364 |     0.000 |     1.000 |           | 
##              |     0.047 |     0.073 |     0.094 |     0.071 |     0.010 |     0.000 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        81 |       107 |       100 |        81 |        11 |         1 |         1 |       382 | 
##              |     0.212 |     0.280 |     0.262 |     0.212 |     0.029 |     0.003 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 

You can observe that high use of alcohol didn’t alter the average final grades (G3 in the data set) of the female students, and only sligly decreases the amount of the maximum grades. As for the male students you can see a clear drop in the average grades as also the maximum grades (you can see this from the variation lines)

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  382 
## 
##  
##              | alc$absences 
## alc$high_use |         0 |         1 |         2 |         3 |         4 |         5 |         6 |         7 |         8 |         9 |        10 |        11 |        12 |        13 |        14 |        16 |        17 |        18 |        19 |        20 |        21 |        26 |        27 |        29 |        44 |        45 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##        FALSE |        52 |        38 |        42 |        33 |        24 |        16 |        16 |         9 |        14 |         6 |         5 |         2 |         4 |         1 |         1 |         0 |         0 |         1 |         0 |         2 |         1 |         0 |         0 |         0 |         0 |         1 |       268 | 
##              |     0.898 |     0.138 |     0.042 |     0.624 |     0.063 |     0.021 |     0.109 |     0.040 |     0.000 |     0.695 |     0.002 |     1.160 |     0.463 |     0.116 |     3.115 |     0.702 |     0.702 |     0.116 |     0.702 |     0.254 |     0.116 |     0.702 |     0.702 |     0.702 |     0.702 |     0.127 |           | 
##              |     0.194 |     0.142 |     0.157 |     0.123 |     0.090 |     0.060 |     0.060 |     0.034 |     0.052 |     0.022 |     0.019 |     0.007 |     0.015 |     0.004 |     0.004 |     0.000 |     0.000 |     0.004 |     0.000 |     0.007 |     0.004 |     0.000 |     0.000 |     0.000 |     0.000 |     0.004 |     0.702 | 
##              |     0.800 |     0.745 |     0.724 |     0.805 |     0.667 |     0.727 |     0.762 |     0.750 |     0.700 |     0.500 |     0.714 |     0.333 |     0.500 |     0.500 |     0.143 |     0.000 |     0.000 |     0.500 |     0.000 |     1.000 |     0.500 |     0.000 |     0.000 |     0.000 |     0.000 |     1.000 |           | 
##              |     0.136 |     0.099 |     0.110 |     0.086 |     0.063 |     0.042 |     0.042 |     0.024 |     0.037 |     0.016 |     0.013 |     0.005 |     0.010 |     0.003 |     0.003 |     0.000 |     0.000 |     0.003 |     0.000 |     0.005 |     0.003 |     0.000 |     0.000 |     0.000 |     0.000 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##         TRUE |        13 |        13 |        16 |         8 |        12 |         6 |         5 |         3 |         6 |         6 |         2 |         4 |         4 |         1 |         6 |         1 |         1 |         1 |         1 |         0 |         1 |         1 |         1 |         1 |         1 |         0 |       114 | 
##              |     2.110 |     0.324 |     0.099 |     1.466 |     0.147 |     0.049 |     0.256 |     0.094 |     0.000 |     1.634 |     0.004 |     2.726 |     1.089 |     0.272 |     7.322 |     1.649 |     1.649 |     0.272 |     1.649 |     0.597 |     0.272 |     1.649 |     1.649 |     1.649 |     1.649 |     0.298 |           | 
##              |     0.114 |     0.114 |     0.140 |     0.070 |     0.105 |     0.053 |     0.044 |     0.026 |     0.053 |     0.053 |     0.018 |     0.035 |     0.035 |     0.009 |     0.053 |     0.009 |     0.009 |     0.009 |     0.009 |     0.000 |     0.009 |     0.009 |     0.009 |     0.009 |     0.009 |     0.000 |     0.298 | 
##              |     0.200 |     0.255 |     0.276 |     0.195 |     0.333 |     0.273 |     0.238 |     0.250 |     0.300 |     0.500 |     0.286 |     0.667 |     0.500 |     0.500 |     0.857 |     1.000 |     1.000 |     0.500 |     1.000 |     0.000 |     0.500 |     1.000 |     1.000 |     1.000 |     1.000 |     0.000 |           | 
##              |     0.034 |     0.034 |     0.042 |     0.021 |     0.031 |     0.016 |     0.013 |     0.008 |     0.016 |     0.016 |     0.005 |     0.010 |     0.010 |     0.003 |     0.016 |     0.003 |     0.003 |     0.003 |     0.003 |     0.000 |     0.003 |     0.003 |     0.003 |     0.003 |     0.003 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        65 |        51 |        58 |        41 |        36 |        22 |        21 |        12 |        20 |        12 |         7 |         6 |         8 |         2 |         7 |         1 |         1 |         2 |         1 |         2 |         2 |         1 |         1 |         1 |         1 |         1 |       382 | 
##              |     0.170 |     0.134 |     0.152 |     0.107 |     0.094 |     0.058 |     0.055 |     0.031 |     0.052 |     0.031 |     0.018 |     0.016 |     0.021 |     0.005 |     0.018 |     0.003 |     0.003 |     0.005 |     0.003 |     0.005 |     0.005 |     0.003 |     0.003 |     0.003 |     0.003 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 

Once again the high use of alcohol didn’t alter the average number of absences of the female students, and only sligly increased the amount of the maximum number of absences (top of the box plot). As before, the alcohol consuption has more effect on the male students. You can see that the absences number increased (noticeable from the increase in the average of absences, the mimunim number of absences and maximum number of absences).

## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## | Chi-square contribution |
## |           N / Row Total |
## |           N / Col Total |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  382 
## 
##  
##              | alc$age 
## alc$high_use |        15 |        16 |        17 |        18 |        19 |        20 |        22 | Row Total | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##        FALSE |        63 |        79 |        64 |        54 |         7 |         1 |         0 |       268 | 
##              |     0.671 |     0.206 |     0.540 |     0.141 |     0.067 |     0.127 |     0.702 |           | 
##              |     0.235 |     0.295 |     0.239 |     0.201 |     0.026 |     0.004 |     0.000 |     0.702 | 
##              |     0.778 |     0.738 |     0.640 |     0.667 |     0.636 |     1.000 |     0.000 |           | 
##              |     0.165 |     0.207 |     0.168 |     0.141 |     0.018 |     0.003 |     0.000 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
##         TRUE |        18 |        28 |        36 |        27 |         4 |         0 |         1 |       114 | 
##              |     1.576 |     0.484 |     1.270 |     0.331 |     0.157 |     0.298 |     1.649 |           | 
##              |     0.158 |     0.246 |     0.316 |     0.237 |     0.035 |     0.000 |     0.009 |     0.298 | 
##              |     0.222 |     0.262 |     0.360 |     0.333 |     0.364 |     0.000 |     1.000 |           | 
##              |     0.047 |     0.073 |     0.094 |     0.071 |     0.010 |     0.000 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## Column Total |        81 |       107 |       100 |        81 |        11 |         1 |         1 |       382 | 
##              |     0.212 |     0.280 |     0.262 |     0.212 |     0.029 |     0.003 |     0.003 |           | 
## -------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
## 
## 

You can see that while the heavy alcohol consumption in the females is distributed from 16 to 17 yeard old, in the male students the high alcohol intake spreads from 16 to 18 years old. If you compare this ages with the ones from the low or non alcohol consumption, you can realize that all the male students with 17y or older are high user of alcohol.

3.5 Use logistic regression to statistically explore the relationship between chosen variables and the binary high/low alcohol consumption variable as the target variable.

## 
## Call:
## glm(formula = high_use ~ age + absences + sex + G3, family = "binomial", 
##     data = alc)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2729  -0.8326  -0.6292   1.0442   2.1190  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -3.38339    1.84796  -1.831 0.067120 .  
## age          0.13985    0.10328   1.354 0.175690    
## absences     0.08964    0.02309   3.882 0.000104 ***
## sexM         0.98580    0.24184   4.076 4.58e-05 ***
## G3          -0.06631    0.03624  -1.830 0.067277 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 465.68  on 381  degrees of freedom
## Residual deviance: 423.66  on 377  degrees of freedom
## AIC: 433.66
## 
## Number of Fisher Scoring iterations: 4
## (Intercept)         age    absences        sexM          G3 
## -3.38338833  0.13985344  0.08963638  0.98580237 -0.06630516

3.5.1 Present and interpret the coefficients of the model as odds ratios and provide confidence intervals for them.

## Waiting for profiling to be done...
##                     OR        2.5 %   97.5 %
## (Intercept) 0.03393229 0.0008683319 1.237502
## age         1.15010522 0.9401979286 1.410759
## absences    1.09377649 1.0474354900 1.146836
## sexM        2.67996134 1.6781593816 4.338864
## G3          0.93584524 0.8710385897 1.004426

3.6 Compute the total proportion of inaccurately classified individuals (= the training error) and comment on all the results.

##    age absences sex high_use probability prediction
## 1   18        5   F    FALSE   0.2792297      FALSE
## 2   17        3   F    FALSE   0.2197006      FALSE
## 3   15        8   F     TRUE   0.2145267      FALSE
## 4   15        1   F    FALSE   0.1067647      FALSE
## 5   16        2   F    FALSE   0.1465247      FALSE
## 6   16        8   M    FALSE   0.4082723      FALSE
## 7   16        0   M    FALSE   0.2777614      FALSE
## 8   17        4   F    FALSE   0.2124223      FALSE
## 9   15        0   M    FALSE   0.1834303      FALSE
## 10  15        0   M    FALSE   0.2265217      FALSE
##         prediction
## high_use FALSE TRUE
##    FALSE   255   13
##    TRUE     84   30

You can check in the tables in how many student cases the prediction wouldn’t have assumed a correlation for high use of alcohol and the selected variables. In the 2 x 2 summary table you can see that in 84 cases the prediction claimed no relation but in the real cases you could detect a relationship between the variables. 30 cases there was in both prediction and data analysis a relation between high use of alcohol and the chosen variables.

3.7 Perform 10-fold cross-validation on your model

## [1] 0.2539267
## [1] 0.2670157

Performing an higher number of cross validation you can decrease the number of errors in our predictions.

4 Clustering and classification

This chapter will teach you how one can cluster and classify datasets. There is different methods to perform the clustering of the data, but in a very simple point of view you cluster what is similar. For that you can use different parameters, from simple concepts of means to more complex concepts like data populations distances.

4.1 About this week working data set “Boston”

The data set Boston is included in the library {MASS} and refers to the “Housing Values in Suburbs of Boston”. The data compiled in the dataset orginates from the following papers: Harrison and Rubinfeld (1978) & Belsley et al 1980

4.2 The data to be used in this exercise will be loaded from the library {MASS}.

## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ tibble  1.3.4     ✔ purrr   0.2.4
## ✔ tidyr   0.7.2     ✔ stringr 1.2.0
## ✔ readr   1.1.1     ✔ forcats 0.2.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ✖ MASS::select()  masks dplyr::select()

The Boston data set includes the Housing Values in Suburbs of Boston (from 1978 - 1980). The information included in this data set includes values regarding Boston city crime, nitrogen oxide concentrations, average rooms per dwelling, lower status of the population, pupil-teacher ratio in town, etc..

## 'data.frame':    506 obs. of  14 variables:
##  $ crim   : num  0.00632 0.02731 0.02729 0.03237 0.06905 ...
##  $ zn     : num  18 0 0 0 0 0 12.5 12.5 12.5 12.5 ...
##  $ indus  : num  2.31 7.07 7.07 2.18 2.18 2.18 7.87 7.87 7.87 7.87 ...
##  $ chas   : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ nox    : num  0.538 0.469 0.469 0.458 0.458 0.458 0.524 0.524 0.524 0.524 ...
##  $ rm     : num  6.58 6.42 7.18 7 7.15 ...
##  $ age    : num  65.2 78.9 61.1 45.8 54.2 58.7 66.6 96.1 100 85.9 ...
##  $ dis    : num  4.09 4.97 4.97 6.06 6.06 ...
##  $ rad    : int  1 2 2 3 3 3 5 5 5 5 ...
##  $ tax    : num  296 242 242 222 222 222 311 311 311 311 ...
##  $ ptratio: num  15.3 17.8 17.8 18.7 18.7 18.7 15.2 15.2 15.2 15.2 ...
##  $ black  : num  397 397 393 395 397 ...
##  $ lstat  : num  4.98 9.14 4.03 2.94 5.33 ...
##  $ medv   : num  24 21.6 34.7 33.4 36.2 28.7 22.9 27.1 16.5 18.9 ...
## [1] 506  14

You can see that the data includes a total of 506 observations distributed into the following 14 variables: - crim = per capita crime rate by town. - zn = proportion of residential land zoned for lots over 25,000 sq.ft. - indus = proportion of non-retail business acres per town. - chas = Charles River dummy variable (= 1 if tract bounds river; 0 otherwise). - nox = nitrogen oxides concentration (parts per 10 million). - rm = average number of rooms per dwelling. - age = proportion of owner-occupied units built prior to 1940. - dis = weighted mean of distances to five Boston employment centres. - rad = index of accessibility to radial highways. - tax = full-value property-tax rate per $10,000. - ptratio = pupil-teacher ratio by town. - black = 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town. - lstat = lower status of the population (percent). - medv = median value of owner-occupied homes in $1000s.

4.3 Lets have a graphical overview of the data

  • From the graphical overview using the ggpairs between the variables you can start by observing which of the variables are normally distributed and which of them presented skewed data. In this data set most of the variables presented themselves skewed in either direction, being the rm (average number of rooms per dwelling) the only variable that presents a normal distribution.

4.3.1 For a better understanding of the data lets also have a look on the summaries of the variables included in this dataset.

##       crim                zn             indus            chas        
##  Min.   : 0.00632   Min.   :  0.00   Min.   : 0.46   Min.   :0.00000  
##  1st Qu.: 0.08204   1st Qu.:  0.00   1st Qu.: 5.19   1st Qu.:0.00000  
##  Median : 0.25651   Median :  0.00   Median : 9.69   Median :0.00000  
##  Mean   : 3.61352   Mean   : 11.36   Mean   :11.14   Mean   :0.06917  
##  3rd Qu.: 3.67708   3rd Qu.: 12.50   3rd Qu.:18.10   3rd Qu.:0.00000  
##  Max.   :88.97620   Max.   :100.00   Max.   :27.74   Max.   :1.00000  
##       nox               rm             age              dis        
##  Min.   :0.3850   Min.   :3.561   Min.   :  2.90   Min.   : 1.130  
##  1st Qu.:0.4490   1st Qu.:5.886   1st Qu.: 45.02   1st Qu.: 2.100  
##  Median :0.5380   Median :6.208   Median : 77.50   Median : 3.207  
##  Mean   :0.5547   Mean   :6.285   Mean   : 68.57   Mean   : 3.795  
##  3rd Qu.:0.6240   3rd Qu.:6.623   3rd Qu.: 94.08   3rd Qu.: 5.188  
##  Max.   :0.8710   Max.   :8.780   Max.   :100.00   Max.   :12.127  
##       rad              tax           ptratio          black       
##  Min.   : 1.000   Min.   :187.0   Min.   :12.60   Min.   :  0.32  
##  1st Qu.: 4.000   1st Qu.:279.0   1st Qu.:17.40   1st Qu.:375.38  
##  Median : 5.000   Median :330.0   Median :19.05   Median :391.44  
##  Mean   : 9.549   Mean   :408.2   Mean   :18.46   Mean   :356.67  
##  3rd Qu.:24.000   3rd Qu.:666.0   3rd Qu.:20.20   3rd Qu.:396.23  
##  Max.   :24.000   Max.   :711.0   Max.   :22.00   Max.   :396.90  
##      lstat            medv      
##  Min.   : 1.73   Min.   : 5.00  
##  1st Qu.: 6.95   1st Qu.:17.02  
##  Median :11.36   Median :21.20  
##  Mean   :12.65   Mean   :22.53  
##  3rd Qu.:16.95   3rd Qu.:25.00  
##  Max.   :37.97   Max.   :50.00
  • From the variables summary you can mainly check the ranges of the data in the different variables. The skweded distrubition of most variables is now noticeable when you compare the Mean values and the minimum and maximum values of the data.

4.3.2 For a better understanding on how the variables relate to each other, lets visualize a correlation plot.

## corrplot 0.84 loaded
##          crim    zn indus  chas   nox    rm   age   dis   rad   tax
## crim     1.00 -0.20  0.41 -0.06  0.42 -0.22  0.35 -0.38  0.63  0.58
## zn      -0.20  1.00 -0.53 -0.04 -0.52  0.31 -0.57  0.66 -0.31 -0.31
## indus    0.41 -0.53  1.00  0.06  0.76 -0.39  0.64 -0.71  0.60  0.72
## chas    -0.06 -0.04  0.06  1.00  0.09  0.09  0.09 -0.10 -0.01 -0.04
## nox      0.42 -0.52  0.76  0.09  1.00 -0.30  0.73 -0.77  0.61  0.67
## rm      -0.22  0.31 -0.39  0.09 -0.30  1.00 -0.24  0.21 -0.21 -0.29
## age      0.35 -0.57  0.64  0.09  0.73 -0.24  1.00 -0.75  0.46  0.51
## dis     -0.38  0.66 -0.71 -0.10 -0.77  0.21 -0.75  1.00 -0.49 -0.53
## rad      0.63 -0.31  0.60 -0.01  0.61 -0.21  0.46 -0.49  1.00  0.91
## tax      0.58 -0.31  0.72 -0.04  0.67 -0.29  0.51 -0.53  0.91  1.00
## ptratio  0.29 -0.39  0.38 -0.12  0.19 -0.36  0.26 -0.23  0.46  0.46
## black   -0.39  0.18 -0.36  0.05 -0.38  0.13 -0.27  0.29 -0.44 -0.44
## lstat    0.46 -0.41  0.60 -0.05  0.59 -0.61  0.60 -0.50  0.49  0.54
## medv    -0.39  0.36 -0.48  0.18 -0.43  0.70 -0.38  0.25 -0.38 -0.47
##         ptratio black lstat  medv
## crim       0.29 -0.39  0.46 -0.39
## zn        -0.39  0.18 -0.41  0.36
## indus      0.38 -0.36  0.60 -0.48
## chas      -0.12  0.05 -0.05  0.18
## nox        0.19 -0.38  0.59 -0.43
## rm        -0.36  0.13 -0.61  0.70
## age        0.26 -0.27  0.60 -0.38
## dis       -0.23  0.29 -0.50  0.25
## rad        0.46 -0.44  0.49 -0.38
## tax        0.46 -0.44  0.54 -0.47
## ptratio    1.00 -0.18  0.37 -0.51
## black     -0.18  1.00 -0.37  0.33
## lstat      0.37 -0.37  1.00 -0.74
## medv      -0.51  0.33 -0.74  1.00

  • By drawing the correlation plot you can see some variables are highly positive or negatively correlated with each other.

  • High positive numbers (Blue) mean that variables value will shift together in the same direction. For example, when you look at the crime data, you can see its higly positvely correlated with the tax, rad and lstat variables. Meaning that the higher the index of acessibility to radial highways, the higher value of property-tax rate per $10.000, and the amount of low status of the population the bigger amount of crime you can witness on those areas.

  • On the other side, you can also observe some High negative numbers (Red) meaning that while the value of one variable increases the other one will decrease. For example, you can see how lstat (percentage of the lower status of the population) inversely correlates with medv (median value of owner-occupied homes in $1000s) and rm (average number of rooms per dwelling). Meaning that the higher amount of low status population the less amount of rooms per dwelling, and the less amount of owner occupied homes with the value of $1000.

4.4 Standardizing the dataset and explore the scaled data summary and how variables change.

##       crim                 zn               indus        
##  Min.   :-0.419367   Min.   :-0.48724   Min.   :-1.5563  
##  1st Qu.:-0.410563   1st Qu.:-0.48724   1st Qu.:-0.8668  
##  Median :-0.390280   Median :-0.48724   Median :-0.2109  
##  Mean   : 0.000000   Mean   : 0.00000   Mean   : 0.0000  
##  3rd Qu.: 0.007389   3rd Qu.: 0.04872   3rd Qu.: 1.0150  
##  Max.   : 9.924110   Max.   : 3.80047   Max.   : 2.4202  
##       chas              nox                rm               age         
##  Min.   :-0.2723   Min.   :-1.4644   Min.   :-3.8764   Min.   :-2.3331  
##  1st Qu.:-0.2723   1st Qu.:-0.9121   1st Qu.:-0.5681   1st Qu.:-0.8366  
##  Median :-0.2723   Median :-0.1441   Median :-0.1084   Median : 0.3171  
##  Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000  
##  3rd Qu.:-0.2723   3rd Qu.: 0.5981   3rd Qu.: 0.4823   3rd Qu.: 0.9059  
##  Max.   : 3.6648   Max.   : 2.7296   Max.   : 3.5515   Max.   : 1.1164  
##       dis               rad               tax             ptratio       
##  Min.   :-1.2658   Min.   :-0.9819   Min.   :-1.3127   Min.   :-2.7047  
##  1st Qu.:-0.8049   1st Qu.:-0.6373   1st Qu.:-0.7668   1st Qu.:-0.4876  
##  Median :-0.2790   Median :-0.5225   Median :-0.4642   Median : 0.2746  
##  Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000  
##  3rd Qu.: 0.6617   3rd Qu.: 1.6596   3rd Qu.: 1.5294   3rd Qu.: 0.8058  
##  Max.   : 3.9566   Max.   : 1.6596   Max.   : 1.7964   Max.   : 1.6372  
##      black             lstat              medv        
##  Min.   :-3.9033   Min.   :-1.5296   Min.   :-1.9063  
##  1st Qu.: 0.2049   1st Qu.:-0.7986   1st Qu.:-0.5989  
##  Median : 0.3808   Median :-0.1811   Median :-0.1449  
##  Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000  
##  3rd Qu.: 0.4332   3rd Qu.: 0.6024   3rd Qu.: 0.2683  
##  Max.   : 0.4406   Max.   : 3.5453   Max.   : 2.9865
## [1] "matrix"
  • When scaling the data, you just change the scale from which the data distributes in the x axis, not changing the values of the data itself. One can think this process is like grabbing the axis at the two ends and stretching or compressing it in order to make all your variables vary in the same comparable range, making it easier to compare. The scaling takes in account the mean (average) and standard deviation of the data.

4.4.1 Create a categorical variable of the crime rate in the Boston dataset (from the scaled crime rate). Quantiles from the old “crim”" variable will be used as the break points for the new “crime”" categorical variable.

##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## -0.419367 -0.410563 -0.390280  0.000000  0.007389  9.924110
##           0%          25%          50%          75%         100% 
## -0.419366929 -0.410563278 -0.390280295  0.007389247  9.924109610
## crime
##      low  med_low med_high     high 
##      127      126      126      127
  • The new crime variable is now easier to interpret the amount of data fiiting in the the new assigned labels: “low”, “med_low”, “med_high”, “high”. You can also verify how the distribution between this categories is quite even.

4.4.2 Since the new crime category looks more informative, let’s drop the old crim variable from the dataset.

## # A tibble: 506 x 14
## # Groups:   crime [4]
##             zn      indus       chas        nox         rm         age
##  *       <dbl>      <dbl>      <dbl>      <dbl>      <dbl>       <dbl>
##  1  0.28454827 -1.2866362 -0.2723291 -0.1440749  0.4132629 -0.11989477
##  2 -0.48724019 -0.5927944 -0.2723291 -0.7395304  0.1940824  0.36680343
##  3 -0.48724019 -0.5927944 -0.2723291 -0.7395304  1.2814456 -0.26554897
##  4 -0.48724019 -1.3055857 -0.2723291 -0.8344581  1.0152978 -0.80908783
##  5 -0.48724019 -1.3055857 -0.2723291 -0.8344581  1.2273620 -0.51067434
##  6 -0.48724019 -1.3055857 -0.2723291 -0.8344581  0.2068916 -0.35080997
##  7  0.04872402 -0.4761823 -0.2723291 -0.2648919 -0.3880270 -0.07015919
##  8  0.04872402 -0.4761823 -0.2723291 -0.2648919 -0.1603069  0.97784057
##  9  0.04872402 -0.4761823 -0.2723291 -0.2648919 -0.9302853  1.11638970
## 10  0.04872402 -0.4761823 -0.2723291 -0.2648919 -0.3994130  0.61548134
## # ... with 496 more rows, and 8 more variables: dis <dbl>, rad <dbl>,
## #   tax <dbl>, ptratio <dbl>, black <dbl>, lstat <dbl>, medv <dbl>,
## #   crime <fctr>
  • Now you can easily explore how the other variables vary according to the high or low crime rate category, and to have a better understanding on that I group the variables by crime categories.

4.4.3 Divide the dataset to train and test sets, so that 80% of the data belongs to the train set.

## [1] 506
##              zn       indus       chas         nox           rm
## 140 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.190195170
## 80  -0.48724019  0.24681257 -0.2723291 -1.01568364 -0.584435480
## 228 -0.48724019 -0.71961001 -0.2723291 -0.43748771  1.250134047
## 30  -0.48724019 -0.43682573 -0.2723291 -0.14407485  0.554164692
## 306  0.92770532 -1.30558569 -0.2723291 -0.71364099  0.471616179
## 305  0.92770532 -1.30558569 -0.2723291 -0.71364099  1.354031312
## 28  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.338213193
## 492 -0.48724019  2.42017014 -0.2723291  0.46864023 -0.429301206
## 329 -0.48724019 -1.15107469 -0.2723291 -0.81719847 -0.592974981
## 174 -0.48724019 -1.03300497 -0.2723291 -0.38570897  0.186966136
## 97  -0.48724019 -1.20209248 -0.2723291 -0.94664532 -0.173116168
## 278  1.22784527 -0.68899934  3.6647712 -0.92938574  0.770498724
## 23  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.203004422
## 72  -0.48724019 -0.04763292 -0.2723291 -1.22279860 -0.460612711
## 162 -0.48724019  1.23072696 -0.2723291  0.43412107  1.714113616
## 383 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.065494052
## 197  2.94293073 -1.40179066 -0.2723291 -1.30046671  1.426617073
## 196  2.94293073 -1.55630166 -0.2723291 -1.14513049  2.263488199
## 353  2.08538800 -1.37701059 -0.2723291 -1.24005818 -0.570202978
## 488 -0.48724019  1.01499462 -0.2723291  0.24426569 -0.540314723
## 464 -0.48724019  1.01499462 -0.2723291  1.36613839  0.325021407
## 268  0.37030254 -1.04466617 -0.2723291  0.17522737  2.864099790
## 333  1.01345959 -0.74001712 -0.2723291 -1.00791683 -0.360985196
## 262  0.37030254 -1.04466617 -0.2723291  0.79657225  1.758234373
## 60   0.58468822 -0.87557866 -0.2723291 -0.87760700 -0.509003218
## 434 -0.48724019  1.01499462 -0.2723291  1.36613839  0.215431141
## 303  0.97058245 -0.73564417 -0.2723291 -1.05020280  0.299402903
## 472 -0.48724019  1.01499462 -0.2723291 -0.19585359 -0.079181654
## 270  0.37030254 -0.60882854  3.6647712 -0.78267931 -0.518965970
## 425 -0.48724019  1.01499462 -0.2723291  0.25289548 -1.024219796
## 118 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.375217698
## 241  0.79907391 -0.90473168 -0.2723291 -1.09335175  0.871549489
## 423 -0.48724019  1.01499462 -0.2723291  0.51178918 -0.906090028
## 315 -0.48724019 -0.18027916 -0.2723291 -0.09229612  0.401876919
## 132 -0.48724019  1.56744433 -0.2723291  0.59808708  0.058873617
## 211 -0.48724019 -0.07970124  3.6647712 -0.56693456 -0.462035961
## 68   0.04872402 -0.73855947 -0.2723291 -1.25731776 -0.578742479
## 43  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.164576667
## 345  1.87100232 -1.07236154 -0.2723291 -0.61008351  0.838814735
## 194  2.08538800 -1.19626187 -0.2723291 -1.32635608  0.733494219
## 388 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.828356167
## 220 -0.48724019  0.40132357  3.6647712 -0.04051738  0.125766377
## 269  0.37030254 -1.04466617 -0.2723291  0.17522737  1.687071862
## 18  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.419338455
## 20  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.793653261
## 61   0.58468822 -0.87557866 -0.2723291 -0.87760700 -0.773727758
## 148 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.933676683
## 313 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.372371198
## 52   0.41317968 -0.80123846 -0.2723291 -0.99842406 -0.241432178
## 42  -0.48724019 -0.61611679 -0.2723291 -0.92075595  0.690796712
## 481 -0.48724019  1.01499462 -0.2723291 -0.19585359 -0.060679401
## 123 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.460612711
## 37  -0.48724019 -0.75459363 -0.2723291 -0.48063666 -0.631402737
## 418 -0.48724019  1.01499462 -0.2723291  1.07272553 -1.395688102
## 231 -0.48724019 -0.71961001 -0.2723291 -0.43748771 -0.432147707
## 352  2.08538800 -1.37701059 -0.2723291 -1.24005818  0.418955921
## 281  0.37030254 -1.13795583 -0.2723291 -0.96476788  2.185209437
## 255  2.94293073 -1.09276866 -0.2723291 -1.40402419 -0.251394930
## 384 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.088266056
## 56   3.37170210 -1.44552019 -0.2723291 -1.30909650  1.372533565
## 85  -0.48724019 -0.96886832 -0.2723291 -0.91212616  0.148538381
## 86  -0.48724019 -0.96886832 -0.2723291 -0.91212616  0.491541682
## 111 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.127572161
## 84   0.58468822 -0.91493524 -0.2723291 -1.11061133 -0.167423167
## 193  1.44223095 -1.12192167 -0.2723291 -1.01568364  1.271482800
## 426 -0.48724019  1.01499462 -0.2723291  1.07272553 -0.553123975
## 485 -0.48724019  1.01499462 -0.2723291  0.24426569 -0.588705230
## 160 -0.48724019  1.23072696 -0.2723291  2.72964520  0.320751657
## 187 -0.48724019 -1.26477147 -0.2723291 -0.57556435  2.200865190
## 284  3.37170210 -1.44697784  3.6647712 -1.32635608  2.331804209
## 188  1.44223095 -1.12192167 -0.2723291 -1.01568364  0.707875715
## 5   -0.48724019 -1.30558569 -0.2723291 -0.83445805  1.227362043
## 398 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.765188257
## 420 -0.48724019  1.01499462 -0.2723291  1.40928733  0.767652224
## 344  1.87100232 -1.07236154 -0.2723291 -0.61008351  0.585476196
## 44  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.104800158
## 349  2.94293073 -1.33036576 -0.2723291 -1.03294322  0.498657933
## 51   0.41317968 -0.80123846 -0.2723291 -0.99842406 -0.457766211
## 222 -0.48724019 -0.71961001  3.6647712 -0.41159834 -0.171692918
## 484 -0.48724019  1.01499462 -0.2723291 -0.19585359 -0.743839504
## 122 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.399412952
## 496 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.874778524
## 477 -0.48724019  1.01499462 -0.2723291  0.51178918  0.283747151
## 137 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.487654465
## 19  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -1.179354069
## 456 -0.48724019  1.01499462 -0.2723291  1.36613839  0.342100410
## 50  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.971559538
## 296 -0.48724019  0.40569652 -0.2723291 -1.01568364  0.559857693
## 440 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.935978283
## 219 -0.48724019  0.40132357  3.6647712 -0.04051738 -0.474845213
## 69   0.04872402 -0.73855947 -0.2723291 -1.25731776 -0.982945540
## 400 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.615746985
## 93   0.71331963  0.56895343 -0.2723291 -0.78267931  0.223970642
## 312 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.231469427
## 138 -0.48724019  1.56744433 -0.2723291  0.59808708  0.241049645
## 62   0.58468822 -0.87557866 -0.2723291 -0.87760700 -0.453496460
## 340 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.426454706
## 192  1.44223095 -1.12192167 -0.2723291 -1.01568364  0.646675956
## 482 -0.48724019  1.01499462 -0.2723291 -0.19585359  0.662331708
## 77  -0.48724019  0.24681257 -0.2723291 -1.01568364 -0.008019143
## 38  -0.48724019 -0.75459363 -0.2723291 -0.48063666 -0.618593485
## 173 -0.48724019 -1.03300497 -0.2723291 -0.38570897 -1.014257045
## 236 -0.48724019 -0.71961001 -0.2723291 -0.41159834 -0.282706434
## 330 -0.48724019 -1.15107469 -0.2723291 -0.81719847  0.068836369
## 124 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.610053984
## 218 -0.48724019  0.40132357 -0.2723291 -0.04051738  0.508620685
## 435 -0.48724019  1.01499462 -0.2723291  1.36613839 -0.109069908
## 116 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.507579968
## 392 -0.48724019  1.01499462 -0.2723291  1.25395112 -0.332520192
## 253  0.45605682 -0.76917014 -0.2723291 -1.06746238  0.956944502
## 437 -0.48724019  1.01499462 -0.2723291  1.59914271  0.251012396
## 361 -0.48724019  1.01499462 -0.2723291  1.85803641  0.161347633
## 410 -0.48724019  1.01499462 -0.2723291  0.36508275  0.807503230
## 438 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.188771920
## 254  0.45605682 -0.76917014 -0.2723291 -1.06746238  2.810016281
## 207 -0.48724019 -0.07970124 -0.2723291 -0.56693456  0.058873617
## 39  -0.48724019 -0.75459363 -0.2723291 -0.48063666 -0.453496460
## 79  -0.48724019  0.24681257 -0.2723291 -1.01568364 -0.074911903
## 40   2.72854505 -1.19334657 -0.2723291 -1.09335175  0.441727925
## 504 -0.48724019  0.11562398 -0.2723291  0.15796779  0.983986256
## 214 -0.48724019 -0.07970124 -0.2723291 -0.56693456  0.128612878
## 412 -0.48724019  1.01499462 -0.2723291  0.36508275  0.529969438
## 432 -0.48724019  1.01499462 -0.2723291  0.25289548  0.780461476
## 271  0.37030254 -0.60882854 -0.2723291 -0.78267931 -0.610053984
## 272  0.37030254 -0.60882854 -0.2723291 -0.78267931 -0.063525901
## 82   0.58468822 -0.91493524 -0.2723291 -1.11061133  0.475885930
## 291  2.94293073 -0.90181638 -0.2723291 -1.24005818  0.820312482
## 234 -0.48724019 -0.71961001 -0.2723291 -0.41159834  2.792937279
## 76  -0.48724019  0.24681257 -0.2723291 -1.01568364  0.001943608
## 242  0.79907391 -0.90473168 -0.2723291 -1.09335175 -0.269897182
## 147 -0.48724019  1.23072696 -0.2723291  2.72964520 -0.934555033
## 415 -0.48724019  1.01499462 -0.2723291  1.19354259 -2.512939520
## 486 -0.48724019  1.01499462 -0.2723291  0.24426569  0.038948114
## 117 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.154613915
## 411 -0.48724019  1.01499462 -0.2723291  0.36508275 -0.750955755
## 491 -0.48724019  2.42017014 -0.2723291  0.46864023 -1.695993897
## 346 -0.48724019 -0.98344483 -0.2723291 -0.97253469 -0.385180450
## 267  0.37030254 -1.04466617 -0.2723291  0.79657225  1.038069765
## 436 -0.48724019  1.01499462 -0.2723291  1.59914271  0.490118432
## 501 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.366678197
## 163 -0.48724019  1.23072696  3.6647712  0.43412107  2.159590934
## 395 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.565933227
## 318 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.715374500
## 55   2.72854505 -1.04029322 -0.2723291 -1.24868797 -0.564509977
## 405 -0.48724019  1.01499462 -0.2723291  1.19354259 -1.072610303
## 9    0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.930285282
## 88  -0.48724019 -0.96886832 -0.2723291 -0.91212616 -0.232892677
## 135 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.750955755
## 178 -0.48724019 -1.03300497 -0.2723291 -0.38570897  0.043217865
## 232 -0.48724019 -0.71961001 -0.2723291 -0.43748771  1.604523350
## 99  -0.48724019 -1.20209248 -0.2723291 -0.94664532  2.185209437
## 22  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.454919710
## 4   -0.48724019 -1.30558569 -0.2723291 -0.83445805  1.015297761
## 83   0.58468822 -0.91493524 -0.2723291 -1.11061133  0.024715612
## 81   0.58468822 -0.91493524 -0.2723291 -1.11061133  0.629596953
## 154 -0.48724019  1.23072696 -0.2723291  2.72964520 -0.819271765
## 293  2.94293073 -0.90181638 -0.2723291 -1.24005818  0.491541682
## 249  0.45605682 -0.76917014 -0.2723291 -1.06746238  0.211161390
## 326 -0.48724019 -0.54760720 -0.2723291 -0.53241540  0.208314890
## 35  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.268473932
## 424 -0.48724019  1.01499462 -0.2723291  0.51178918 -0.258511181
## 71  -0.48724019 -0.04763292 -0.2723291 -1.22279860  0.188389387
## 34  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.830657767
## 363 -0.48724019  1.01499462 -0.2723291  1.85803641 -1.313139590
## 130 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.921745781
## 453 -0.48724019  1.01499462 -0.2723291  1.36613839  0.017599361
## 343 -0.48724019 -1.34785757 -0.2723291 -0.31667065  0.363449163
## 448 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.047870149
## 210 -0.48724019 -0.07970124  3.6647712 -0.56693456 -1.338758093
## 387 -0.48724019  1.01499462 -0.2723291  1.25395112 -2.323647242
## 454 -0.48724019  1.01499462 -0.2723291  1.36613839  1.577481596
## 389 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.999146193
## 94   0.71331963  0.56895343 -0.2723291 -0.78267931 -0.104800158
## 431 -0.48724019  1.01499462 -0.2723291  0.25289548  0.090185122
## 25  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.513272969
## 182 -0.48724019 -1.26477147 -0.2723291 -0.57556435 -0.200157922
## 91  -0.48724019 -1.12629463 -0.2723291 -0.56693456  0.188389387
## 175 -0.48724019 -1.03300497 -0.2723291 -0.38570897 -0.605784233
## 203  3.05012357 -1.32745046 -0.2723291 -1.20553902  1.886326892
## 252  0.45605682 -0.76917014 -0.2723291 -1.06746238  0.218277641
## 402 -0.48724019  1.01499462 -0.2723291  1.19354259  0.083068871
## 107 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.638518988
## 336 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.352445695
## 139 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.608630733
## 498 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.698295497
## 356  2.94293073 -1.34494227 -0.2723291 -1.22279860 -0.496193967
## 266  0.37030254 -1.04466617 -0.2723291  0.79657225 -1.031336047
## 239  0.79907391 -0.90473168 -0.2723291 -1.09335175  0.279477400
## 495 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.510426469
## 259  0.37030254 -1.04466617 -0.2723291  0.79657225  1.492086583
## 380 -0.48724019  1.01499462 -0.2723291  1.00368721 -0.087721155
## 134 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.658444491
## 493 -0.48724019  2.42017014 -0.2723291  0.46864023 -0.429301206
## 221 -0.48724019 -0.71961001  3.6647712 -0.41159834  0.948405001
## 500 -0.48724019 -0.21088983 -0.2723291  0.26152527 -1.018526795
## 416 -0.48724019  1.01499462 -0.2723291  1.07272553  0.212584640
## 497 -0.48724019 -0.21088983 -0.2723291  0.26152527 -1.273288584
## 401 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.423608206
## 350  1.22784527 -1.44114723 -0.2723291 -1.08472196  0.931325998
## 292  2.94293073 -0.90181638 -0.2723291 -1.24005818  1.228785293
## 443 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.093414156
## 301  2.51415937 -1.29683979 -0.2723291 -1.33498587  0.834544984
## 373 -0.48724019  1.01499462  3.6647712  0.97779784 -0.583012230
## 200  3.58608778 -1.40907891 -0.2723291 -1.30909650  0.982563006
## 58   3.80047346 -1.43094368 -0.2723291 -1.24005818  0.756266222
## 101 -0.48724019 -0.37560439 -0.2723291 -0.29941107  0.629596953
## 479 -0.48724019  1.01499462 -0.2723291  0.51178918 -0.141804663
## 439 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.497617217
## 323 -0.48724019 -0.54760720 -0.2723291 -0.53241540 -0.346752694
## 208 -0.48724019 -0.07970124 -0.2723291 -0.56693456 -0.713951249
## 378 -0.48724019  1.01499462 -0.2723291  1.00368721  0.724954717
## 125 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.577319229
## 447 -0.48724019  1.01499462 -0.2723291  1.59914271  0.080222370
## 204  3.58608778 -1.23270315 -0.2723291 -1.19604625  2.232176694
## 32  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.302631937
## 275  1.22784527 -0.68899934  3.6647712 -0.92938574  0.673717710
## 445 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.612900484
## 108 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.224353176
## 462 -0.48724019  1.01499462 -0.2723291  1.36613839  0.130036128
## 230 -0.48724019 -0.71961001 -0.2723291 -0.43748771  0.380528166
## 360 -0.48724019  1.01499462 -0.2723291  1.85803641 -0.245701929
## 446 -0.48724019  1.01499462 -0.2723291  1.59914271  0.248165896
## 74  -0.48724019 -0.04763292 -0.2723291 -1.22279860 -0.056409650
## 64   0.58468822 -0.87557866 -0.2723291 -0.87760700  0.679410711
## 183 -0.48724019 -1.26477147 -0.2723291 -0.57556435  1.238748045
## 250  0.45605682 -0.76917014 -0.2723291 -1.06746238  0.616787701
## 381 -0.48724019  1.01499462 -0.2723291  1.00368721  0.972600255
## 362 -0.48724019  1.01499462 -0.2723291  1.85803641 -0.047870149
## 205  3.58608778 -1.23270315 -0.2723291 -1.19604625  2.489784983
## 136 -0.48724019  1.56744433 -0.2723291  0.59808708  0.071682869
## 417 -0.48724019  1.01499462 -0.2723291  1.07272553  0.707875715
## 119 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.587281980
## 54   0.41317968 -0.80123846 -0.2723291 -0.99842406 -0.407952453
## 368 -0.48724019  1.01499462 -0.2723291  0.65849561 -3.446591661
## 166 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.261357681
## 289  1.76380948 -0.84788329 -0.2723291 -1.29183692  0.043217865
## 341 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.450649960
## 351  1.22784527 -1.44114723 -0.2723291 -1.08472196  0.292286652
## 397 -0.48724019  1.01499462 -0.2723291  1.19354259  0.171310384
## 244  0.79907391 -0.90473168 -0.2723291 -1.09335175  0.154231381
## 321 -0.48724019 -0.54760720 -0.2723291 -0.53241540  0.201198639
## 41   2.72854505 -1.19334657 -0.2723291 -1.09335175  1.052302267
## 177 -0.48724019 -1.03300497 -0.2723291 -0.38570897 -0.376640949
## 287  2.94293073 -1.36680703 -0.2723291 -1.46443272 -0.077758404
## 98  -0.48724019 -1.20209248 -0.2723291 -0.94664532  2.539598741
## 277  1.22784527 -0.68899934  3.6647712 -0.92938574  1.398152069
## 145 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.966411438
## 11   0.04872402 -0.47618230 -0.2723291 -0.26489191  0.131459378
## 285  3.37170210 -1.19043127 -0.2723291 -1.33498587  1.143390280
## 428 -0.48724019  1.01499462 -0.2723291  1.07272553 -0.117609410
## 348  3.15731641 -1.01842846 -0.2723291 -1.08472196  0.329291158
## 17  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.497617217
## 153 -0.48724019  1.23072696  3.6647712  2.72964520 -1.811277165
## 31  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.813578764
## 78  -0.48724019  0.24681257 -0.2723291 -1.01568364 -0.205850923
## 396 -0.48724019  1.01499462 -0.2723291  1.19354259  0.265244898
## 248  0.45605682 -0.76917014 -0.2723291 -1.06746238 -0.083451404
## 120 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.787960260
## 332  1.01345959 -0.74001712 -0.2723291 -1.00791683 -0.823541516
## 167 -0.48724019  1.23072696 -0.2723291  0.43412107  2.340343711
## 357 -0.48724019  1.01499462  3.6647712  1.85803641 -0.103376907
## 322 -0.48724019 -0.54760720 -0.2723291 -0.53241540  0.130036128
## 46  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.857699521
## 419 -0.48724019  1.01499462 -0.2723291  1.07272553 -0.466305712
## 131 -0.48724019  1.56744433 -0.2723291  0.59808708  0.246742645
## 75  -0.48724019  0.24681257 -0.2723291 -1.01568364 -0.016558644
## 65   0.26310970 -1.42219777 -0.2723291 -1.19604625  1.166162284
## 283  0.37030254 -1.13795583  3.6647712 -0.96476788  1.936140650
## 151 -0.48724019  1.23072696 -0.2723291  2.72964520 -0.231469427
## 95   0.71331963  0.56895343 -0.2723291 -0.78267931 -0.050716649
## 319 -0.48724019 -0.18027916 -0.2723291 -0.09229612  0.138575629
## 365 -0.48724019  1.01499462  3.6647712  1.40928733  3.551529643
## 104 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.210120673
## 264  0.37030254 -1.04466617 -0.2723291  0.79657225  1.483547082
## 444 -0.48724019  1.01499462 -0.2723291  1.59914271  0.285170401
## 337 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.591551731
## 421 -0.48724019  1.01499462 -0.2723291  1.40928733  0.179849885
## 372 -0.48724019  1.01499462 -0.2723291  0.65849561 -0.097683907
## 106 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.617170235
## 176 -0.48724019 -1.03300497 -0.2723291 -0.38570897  0.371988664
## 189  1.44223095 -1.12192167 -0.2723291 -1.01568364  0.386221166
## 238 -0.48724019 -0.71961001 -0.2723291 -0.41159834  1.527667838
## 100 -0.48724019 -1.20209248 -0.2723291 -0.94664532  1.610216351
## 391 -0.48724019  1.01499462 -0.2723291  1.25395112 -0.813578764
## 195  2.08538800 -1.19626187 -0.2723291 -1.32635608  0.454537177
## 328 -0.48724019 -0.54760720 -0.2723291 -0.53241540 -0.286976185
## 354  3.37170210 -1.32890811 -0.2723291 -1.24868797  0.631020203
## 92  -0.48724019 -1.12629463 -0.2723291 -0.56693456  0.171310384
## 126 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.425031456
## 45  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.306901688
## 307  0.92770532 -1.30558569 -0.2723291 -0.71364099  1.615909352
## 229 -0.48724019 -0.71961001 -0.2723291 -0.43748771  1.994493909
## 290  1.76380948 -0.84788329 -0.2723291 -1.29183692  0.399030418
## 379 -0.48724019  1.01499462 -0.2723291  1.00368721  0.135729129
## 455 -0.48724019  1.01499462 -0.2723291  1.36613839  0.631020203
## 172 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.575895979
## 465 -0.48724019  1.01499462 -0.2723291  0.86561057 -0.107646658
## 261  0.37030254 -1.04466617 -0.2723291  0.79657225  1.307064055
## 14  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.477691714
## 371 -0.48724019  1.01499462  3.6647712  0.65849561  1.040916265
## 201  3.58608778 -1.40907891 -0.2723291 -1.30909650  1.210283041
## 73  -0.48724019 -0.04763292 -0.2723291 -1.22279860 -0.312594689
## 181 -0.48724019 -1.26477147 -0.2723291 -0.57556435  2.106930676
## 317 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.527505471
## 164 -0.48724019  1.23072696  3.6647712  0.43412107  2.975113306
## 286  1.87100232 -1.29538214 -0.2723291 -1.42991356  0.239626394
## 310 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.444956959
## 33  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.476268464
## 369 -0.48724019  1.01499462 -0.2723291  0.65849561 -1.871053674
## 128 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.842043769
## 209 -0.48724019 -0.07970124  3.6647712 -0.56693456 -0.314017939
## 399 -0.48724019  1.01499462 -0.2723291  1.19354259 -1.183623820
## 309 -0.48724019 -0.18027916 -0.2723291 -0.09229612  0.498657933
## 427 -0.48724019  1.01499462 -0.2723291  0.25289548 -0.637095738
## 63   0.58468822 -0.87557866 -0.2723291 -0.87760700  0.243896145
## 338 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.554547225
## 480 -0.48724019  1.01499462 -0.2723291  0.51178918 -0.079181654
## 467 -0.48724019  1.01499462 -0.2723291  0.86561057 -0.473421963
## 199  2.94293073 -1.40179066 -0.2723291 -1.30046671  1.408114820
## 276  1.22784527 -0.68899934 -0.2723291 -0.92938574  0.810349730
## 473 -0.48724019  1.01499462 -0.2723291  0.21837632  0.216854391
## 324 -0.48724019 -0.54760720 -0.2723291 -0.53241540 -0.820695015
## 115 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.043600398
## 171 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.583012230
## 48  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.362408446
## 429 -0.48724019  1.01499462 -0.2723291  1.07272553 -0.130418661
## 359 -0.48724019  1.01499462  3.6647712  1.85803641 -0.224353176
## 89  -0.48724019 -1.12629463 -0.2723291 -0.56693456  1.028107013
## 469 -0.48724019  1.01499462 -0.2723291  0.21837632 -0.510426469
## 299  2.51415937 -1.29683979 -0.2723291 -1.33498587  0.085915371
## 96  -0.48724019 -1.20209248 -0.2723291 -0.94664532  0.484425431
## 314 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.026521396
## 102 -0.48724019 -0.37560439 -0.2723291 -0.29941107  0.706452465
## 110 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.079181654
## 297 -0.48724019  0.40569652 -0.2723291 -1.01568364  0.376258415
## 406 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.856276271
## 433 -0.48724019  1.01499462 -0.2723291  0.25289548  0.199775388
## 302  0.97058245 -0.73564417 -0.2723291 -1.05020280  0.434611674
## 142 -0.48724019  1.56744433 -0.2723291  0.59808708 -1.801314413
## 430 -0.48724019  1.01499462 -0.2723291  1.07272553  0.135729129
## 59   0.58468822 -0.87557866 -0.2723291 -0.87760700 -0.198734672
## 184 -0.48724019 -1.26477147 -0.2723291 -0.57556435  0.396183918
## 66   2.94293073 -1.13212523 -0.2723291 -1.35224545  0.007636609
## 156 -0.48724019  1.23072696  3.6647712  2.72964520 -0.188771920
## 452 -0.48724019  1.01499462 -0.2723291  1.36613839  0.527122938
## 494 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.822118266
## 240  0.79907391 -0.90473168 -0.2723291 -1.09335175  0.457383677
## 288  1.76380948 -0.84788329 -0.2723291 -1.29183692 -0.107646658
## 334 -0.48724019 -0.86683276 -0.2723291 -0.34256002  0.044641115
## 235 -0.48724019 -0.71961001  3.6647712 -0.41159834  0.628173703
## 327 -0.48724019 -0.54760720 -0.2723291 -0.53241540  0.038948114
## 7    0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.388026950
## 212 -0.48724019 -0.07970124  3.6647712 -0.56693456 -1.253363081
## 502 -0.48724019  0.11562398 -0.2723291  0.15796779  0.438881424
## 335 -0.48724019 -0.86683276 -0.2723291 -0.34256002  0.036101614
## 342  1.01345959 -1.40179066 -0.2723291 -0.97253469  1.361147563
## 409 -0.48724019  1.01499462 -0.2723291  0.36508275 -0.950210785
## 407 -0.48724019  1.01499462 -0.2723291  0.90012973 -3.055197852
## 300  2.51415937 -1.29683979 -0.2723291 -1.33498587  1.076497520
## 506 -0.48724019  0.11562398 -0.2723291  0.15796779 -0.362408446
## 442 -0.48724019  1.01499462 -0.2723291  1.59914271  0.172733634
## 13   0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.563086727
## 10   0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.399412952
## 53   0.41317968 -0.80123846 -0.2723291 -0.99842406  0.322174907
## 215 -0.48724019 -0.07970124 -0.2723291 -0.56693456 -1.241977079
## 404 -0.48724019  1.01499462 -0.2723291  1.19354259 -1.331641842
## 133 -0.48724019  1.56744433 -0.2723291  0.59808708  0.124343127
## 311 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -1.866783923
## 258  0.37030254 -1.04466617 -0.2723291  0.79657225  3.443362627
## 273  0.37030254 -0.60882854 -0.2723291 -0.78267931  0.360602663
## 375 -0.48724019  1.01499462 -0.2723291  0.97779784 -3.055197852
## 487 -0.48724019  1.01499462 -0.2723291  0.24426569 -0.242855428
## 180 -0.48724019 -1.26477147 -0.2723291 -0.57556435  0.989679257
## 87  -0.48724019 -0.96886832 -0.2723291 -0.91212616 -0.383757200
## 202  3.05012357 -1.32745046 -0.2723291 -1.20553902 -0.174539418
## 186 -0.48724019 -1.26477147 -0.2723291 -0.57556435 -0.187348670
## 304  0.97058245 -0.73564417 -0.2723291 -1.05020280  0.992525758
## 316 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.824964766
## 260  0.37030254 -1.04466617 -0.2723291  0.79657225  0.793270728
## 47  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -0.709681499
## 161 -0.48724019  1.23072696  3.6647712  0.43412107 -0.049293399
## 339 -0.48724019 -0.86683276 -0.2723291 -0.34256002 -0.321134190
## 413 -0.48724019  1.01499462 -0.2723291  0.36508275 -2.357805247
## 155 -0.48724019  1.23072696  3.6647712  2.72964520 -0.221506675
## 457 -0.48724019  1.01499462 -0.2723291  1.36613839 -0.439263958
## 168 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.580165729
## 331 -0.48724019 -1.15107469 -0.2723291 -0.81719847 -0.200157922
## 113 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.528928721
## 474 -0.48724019  1.01499462 -0.2723291  0.51178918  0.989679257
## 377 -0.48724019  1.01499462 -0.2723291  1.00368721  0.518583436
## 247  0.45605682 -0.76917014 -0.2723291 -1.06746238 -0.251394930
## 466 -0.48724019  1.01499462 -0.2723291  0.86561057 -0.748109254
## 141 -0.48724019  1.56744433 -0.2723291  0.59808708 -0.157460416
## 325 -0.48724019 -0.54760720 -0.2723291 -0.53241540  0.185542886
## 169 -0.48724019  1.23072696 -0.2723291  0.43412107  0.048910866
## 246  0.45605682 -0.76917014 -0.2723291 -1.06746238 -0.967289788
## 256  2.94293073 -1.09276866 -0.2723291 -1.40402419 -0.581588979
## 282  0.37030254 -1.13795583 -0.2723291 -0.96476788  0.972600255
## 499 -0.48724019 -0.21088983 -0.2723291  0.26152527 -0.378064199
## 67   2.94293073 -1.13212523 -0.2723291 -1.35224545 -0.708258248
## 265  0.37030254 -1.04466617 -0.2723291  0.79657225  1.311333806
## 471 -0.48724019  1.01499462 -0.2723291  0.21837632 -0.167423167
## 451 -0.48724019  1.01499462 -0.2723291  1.36613839  0.660908458
## 370 -0.48724019  1.01499462  3.6647712  0.65849561  0.566973944
##              age           dis        rad         tax     ptratio
## 140  1.041786323 -1.0097983862 -0.6373311  0.17066179  1.26768382
## 80  -1.135921653  0.3360183832 -0.5224844 -0.06074124  0.11292035
## 228  0.402328842 -0.2751293639 -0.1779443 -0.60068166 -0.48755665
## 30   0.665216917  0.2108349609 -0.6373311 -0.60068166  1.17530274
## 306 -0.372125218 -0.2018524214 -0.2927910 -1.10502160 -0.02565127
## 305 -0.976057283  0.1077818401 -0.2927910 -1.10502160 -0.02565127
## 28   0.718505041  0.3126533438 -0.6373311 -0.60068166  1.17530274
## 492  1.073759197 -0.9151034909 -0.6373311  1.79641644  0.75958789
## 329 -1.519596142  0.6741465952 -0.6373311  0.12912791 -0.71850935
## 174  0.551535588 -0.5455369536 -0.5224844 -0.66594918 -0.85708096
## 97   0.036417061 -0.1423950448 -0.8670245 -0.78461740 -0.21041342
## 278 -1.455650394  0.5070770657 -0.6373311 -0.91515245 -0.39517558
## 23   0.821528746  0.0863638874 -0.6373311 -0.60068166  1.17530274
## 72  -1.814457091  0.7086717651 -0.6373311 -0.61254848  0.34387304
## 162  0.789555872 -0.8662838558 -0.5224844 -0.03107419 -1.73470120
## 383  1.116389695 -1.0517319833  1.6596029  1.52941294  0.80577843
## 197 -1.224735192  1.6687754254 -0.8670245 -0.47014661 -2.70470251
## 196 -1.299338565  0.8801578569 -0.6373311 -0.90921904 -1.87327282
## 353 -1.778931675  3.2840499862 -0.6373311  0.01639310 -0.07184181
## 488 -0.546199754 -0.3052379716  1.6596029  1.52941294  0.80577843
## 464  0.757582998 -0.4717851119  1.6596029  1.52941294  0.80577843
## 268 -0.055949019 -0.6522467981 -0.5224844 -0.85581834 -2.51994036
## 333 -1.608409681  1.3514003073 -0.9818712 -0.61848189 -0.71850935
## 262  0.739820290 -0.7860733853 -0.5224844 -0.85581834 -2.51994036
## 60  -0.759352248  1.4897384367 -0.1779443 -0.73715011  0.57482574
## 434  0.686532167 -0.7024911307  1.6596029  1.52941294  0.80577843
## 303 -1.782484217  0.8057411563 -0.2927910 -0.47014661 -1.08803366
## 472  0.786003330 -0.3304076278  1.6596029  1.52941294  0.80577843
## 270 -0.251338805  0.0581548764 -0.7521778 -1.09908819  0.06672981
## 425  0.071942477 -0.8223081923  1.6596029  1.52941294  0.80577843
## 118  0.498247464 -0.4975246471 -0.4076377  0.14099473 -0.30279450
## 241 -0.507121797  1.2067460189 -0.4076377 -0.64221553 -0.85708096
## 423  0.675874542 -0.8756393696  1.6596029  1.52941294  0.80577843
## 315  0.665216917 -0.0915333432 -0.6373311 -0.61848189 -0.02565127
## 132  1.034681240 -0.7237666137 -0.6373311  0.17066179  1.26768382
## 211  0.835738912  0.0389689498 -0.6373311 -0.77868399  0.06672981
## 68  -1.675907970  1.2836321952 -0.6373311 -0.37521203  0.20530143
## 43  -2.201684121  0.9145880470 -0.7521778 -1.03975408 -0.25660396
## 345 -1.437887686  1.2681504821 -0.5224844 -0.22687676 -0.39517558
## 194 -2.084450250  1.1514202651 -0.9818712 -0.84988492 -1.31898635
## 388  0.743372832 -1.0811757321  1.6596029  1.52941294  0.80577843
## 220  0.846396537 -0.2050342458 -0.5224844 -0.78461740 -0.94946204
## 269 -0.567515004 -0.4383522101 -0.5224844 -0.85581834 -2.51994036
## 18   0.466274590  0.2198105553 -0.6373311 -0.60068166  1.17530274
## 20   0.032864520  0.0006920764 -0.6373311 -0.60068166  1.17530274
## 61  -0.084369352  1.6290738544 -0.1779443 -0.73715011  0.57482574
## 148  0.963630408 -1.1085299245 -0.5224844 -0.03107419 -1.73470120
## 313  0.775345706 -0.4563983787 -0.6373311 -0.61848189 -0.02565127
## 52  -0.198050682  1.4340327636 -0.6373311 -0.98041997 -0.76469989
## 42  -2.333128159  0.9145880470 -0.7521778 -1.03975408 -0.25660396
## 481 -0.137657475 -0.1761128861  1.6596029  1.52941294  0.80577843
## 123  0.864159245 -0.8111955516 -0.8670245 -1.30675758  0.29768250
## 37  -0.254891346 -0.1981007179 -0.5224844 -0.76681717  0.34387304
## 418  0.729162665 -1.0198662487  1.6596029  1.52941294  0.80577843
## 231 -0.016871062 -0.0586703204 -0.1779443 -0.60068166 -0.48755665
## 352 -1.160789444  3.2840499862 -0.6373311  0.01639310 -0.07184181
## 281 -0.144762558  0.4272465145 -0.5224844 -1.14062207 -1.64232012
## 255 -1.299338565  2.5764502168 -0.9818712 -0.55321437 -0.94946204
## 384  1.116389695 -1.0741947142  1.6596029  1.52941294  0.80577843
## 56  -1.658145262  2.3277455193 -0.5224844 -1.08128796 -0.25660396
## 85  -0.730931915  0.4674704746 -0.7521778 -0.95668632  0.02053927
## 86  -0.443176049  0.3051974268 -0.7521778 -0.95668632  0.02053927
## 111 -0.503569256 -0.4830877123 -0.5224844 -0.14380900  1.12911220
## 84  -0.777114956  0.7625253315 -0.6373311 -0.75495035  0.25149196
## 193 -1.501833434  1.2749890302 -0.5224844 -0.06074124 -1.50374851
## 426  0.952972784 -0.8953951752  1.6596029  1.52941294  0.80577843
## 485 -0.947636951 -0.0337381137  1.6596029  1.52941294  0.80577843
## 160  1.116389695 -0.9636381865 -0.5224844 -0.03107419 -1.73470120
## 187 -0.531989588 -0.2829652003 -0.7521778 -1.27709053 -0.30279450
## 284 -1.555121557  0.9925190015 -0.9818712 -1.24742347 -2.24279713
## 188 -0.976057283 -0.0030596271 -0.5224844 -0.06074124 -1.50374851
## 5   -0.510674339  1.0766711351 -0.7521778 -1.10502160  0.11292035
## 398  1.077311738 -1.0265623271  1.6596029  1.52941294  0.80577843
## 420  0.281542429 -0.9502935197  1.6596029  1.52941294  0.80577843
## 344 -0.432518424  0.9199069177 -0.5224844 -0.22687676 -0.39517558
## 44  -2.205236663  0.9145880470 -0.7521778 -1.03975408 -0.25660396
## 349 -1.381047021  2.1602960705 -0.6373311 -0.76088376 -0.67231881
## 51  -0.812640371  1.4340327636 -0.6373311 -0.98041997 -0.76469989
## 222  0.807318580 -0.3547699554 -0.1779443 -0.60068166 -0.48755665
## 484 -1.004477616  0.1440166471  1.6596029  1.52941294  0.80577843
## 122  0.551535588 -0.7587191929 -0.8670245 -1.30675758  0.29768250
## 496 -1.413019895 -0.4732098094 -0.4076377 -0.10227512  0.34387304
## 477  0.889027036 -0.7074775720  1.6596029  1.52941294  0.80577843
## 137  0.885474494 -0.8681834525 -0.6373311  0.17066179  1.26768382
## 19  -1.135921653  0.0006920764 -0.6373311 -0.60068166  1.17530274
## 456  0.636796585 -0.6455032298  1.6596029  1.52941294  0.80577843
## 50  -0.233576097  1.0887810641 -0.7521778 -1.03975408 -0.25660396
## 296 -1.331311439  1.0283263992 -0.6373311 -0.70748306 -1.13422420
## 440  0.899684660 -0.9392758589  1.6596029  1.52941294  0.80577843
## 219  0.896132119 -0.4301364543 -0.5224844 -0.78461740 -0.94946204
## 69  -1.128816570  1.2836321952 -0.6373311 -0.37521203  0.20530143
## 400  0.327725469 -1.0897239172  1.6596029  1.52941294  0.80577843
## 93  -0.531989588 -0.0613297558 -0.6373311 -0.82021787 -0.11803234
## 312 -0.560409921 -0.5483863487 -0.6373311 -0.61848189 -0.02565127
## 138  1.059549031 -0.9237941458 -0.6373311  0.17066179  1.26768382
## 62   0.881921953  1.4358373805 -0.1779443 -0.73715011  0.57482574
## 340 -0.823297996  0.4830471675 -0.5224844 -1.09315478  0.80577843
## 192 -1.341969064  1.2749890302 -0.5224844 -0.06074124 -1.50374851
## 482  0.224701764 -0.2200410597  1.6596029  1.52941294  0.80577843
## 77   0.210491598  0.1221237952 -0.5224844 -0.06074124  0.11292035
## 38  -0.961847117  0.0660856927 -0.5224844 -0.76681717  0.34387304
## 173  0.707847416 -0.5693768922 -0.5224844 -0.66594918 -0.85708096
## 236 -0.251338805 -0.0679783442 -0.1779443 -0.60068166 -0.48755665
## 330 -1.825114716  0.6741465952 -0.6373311  0.12912791 -0.71850935
## 124  1.009813449 -0.8788686839 -0.8670245 -1.30675758  0.29768250
## 218  0.587061003 -0.1775850736 -0.5224844 -0.78461740 -0.94946204
## 435  0.938762618 -0.7469416934  1.6596029  1.52941294  0.80577843
## 116  0.697189791 -0.6325384823 -0.4076377  0.14099473 -0.30279450
## 392  0.494694923 -0.7727762084  1.6596029  1.52941294  0.80577843
## 253 -2.194579038  2.4275218358 -0.2927910 -0.46421320  0.29768250
## 437  0.878369411 -0.8512295520  1.6596029  1.52941294  0.80577843
## 361  0.690084708 -0.6063715378  1.6596029  1.52941294  0.80577843
## 410  1.116389695 -1.1062978984  1.6596029  1.52941294  0.80577843
## 438  1.116389695 -0.8932106390  1.6596029  1.52941294  0.80577843
## 254 -2.137738373  2.4275218358 -0.2927910 -0.46421320  0.29768250
## 207 -0.571067545  0.2658757752 -0.6373311 -0.77868399  0.06672981
## 39  -1.363284313  0.0248169544 -0.5224844 -0.76681717  0.34387304
## 79  -0.528437047  0.5789293108 -0.5224844 -0.06074124  0.11292035
## 40  -1.661697804  0.7627152911 -0.7521778 -0.92701927 -0.07184181
## 504  0.796660955 -0.7729186782 -0.9818712 -0.80241764  1.17530274
## 214 -1.288680940  0.0714045634 -0.6373311 -0.77868399  0.06672981
## 412  1.116389695 -1.0768541496  1.6596029  1.52941294  0.80577843
## 432  0.913894827 -0.8105781827  1.6596029  1.52941294  0.80577843
## 271 -0.940531867  0.3010658040 -0.7521778 -1.09908819  0.06672981
## 272 -1.857087590  0.3010658040 -0.7521778 -1.09908819  0.06672981
## 82   0.064837394  0.7625253315 -0.6373311 -0.75495035  0.25149196
## 291 -1.444992769  0.6276539660 -0.6373311 -0.96855315  0.34387304
## 234  0.064837394 -0.0679783442 -0.1779443 -0.60068166 -0.48755665
## 76  -0.837508162  0.3360183832 -0.5224844 -0.06074124  0.11292035
## 242 -0.123447309  1.2067460189 -0.4076377 -0.64221553 -0.85708096
## 147  1.116389695 -1.0820305506 -0.5224844 -0.03107419 -1.73470120
## 415  1.116389695 -1.0147848276  1.6596029  1.52941294  0.80577843
## 486 -0.592382795  0.0933923952  1.6596029  1.52941294  0.80577843
## 117  0.139440767 -0.5057404029 -0.4076377  0.14099473 -0.30279450
## 411  1.116389695 -1.1312301050  1.6596029  1.52941294  0.80577843
## 491  1.045338864 -0.9367114033 -0.6373311  1.79641644  0.75958789
## 346 -0.713169208  2.0033893834 -0.7521778 -0.33367816  0.15911089
## 267  0.569298295 -0.7893501896 -0.5224844 -0.85581834 -2.51994036
## 436  0.924552451 -0.7932443629  1.6596029  1.52941294  0.80577843
## 501  0.395223759 -0.6158695213 -0.4076377 -0.10227512  0.34387304
## 163  1.052443947 -0.8331358935 -0.5224844 -0.03107419 -1.73470120
## 395  0.928104993 -0.9559448199  1.6596029  1.52941294  0.80577843
## 318  0.111020434  0.1123883621 -0.6373311 -0.61848189 -0.02565127
## 55  -0.745142082  1.6738568465 -0.7521778  0.36053095  1.22149328
## 405  0.597718628 -1.0389097056  1.6596029  1.52941294  0.80577843
## 9    1.116389695  1.0861216287 -0.5224844 -0.57694801 -1.50374851
## 88  -0.418308258 -0.0225304932 -0.7521778 -0.95668632  0.02053927
## 135  1.059549031 -0.6881491756 -0.6373311  0.17066179  1.26768382
## 178  0.171413641 -0.2267846280 -0.5224844 -0.66594918 -0.85708096
## 232  0.295752595 -0.0586703204 -0.1779443 -0.60068166 -0.48755665
## 99  -1.125264029 -0.1423950448 -0.8670245 -0.78461740 -0.21041342
## 22   0.732715207  0.1031753182 -0.6373311 -0.60068166  1.17530274
## 4   -0.809087830  1.0766711351 -0.7521778 -1.10502160  0.11292035
## 83  -1.292233482  0.7625253315 -0.6373311 -0.75495035  0.25149196
## 81  -1.246050442  0.7625253315 -0.6373311 -0.75495035  0.25149196
## 154  1.063101572 -1.0314062987 -0.5224844 -0.03107419 -1.73470120
## 293 -1.604857139  0.6276539660 -0.6373311 -0.96855315  0.34387304
## 249 -0.691853958  1.9145357480 -0.2927910 -0.46421320  0.29768250
## 326 -1.913928255  0.7697437989 -0.5224844 -0.71934988  0.52863520
## 35   1.006260907 -0.0167367233 -0.6373311 -0.60068166  1.17530274
## 424  0.587061003 -0.8421114879  1.6596029  1.52941294  0.80577843
## 71  -2.201684121  0.7086717651 -0.6373311 -0.61254848  0.34387304
## 34   0.938762618 -0.0037244859 -0.6373311 -0.60068166  1.17530274
## 363  0.981393116 -0.8032647354  1.6596029  1.52941294  0.80577843
## 130  0.928104993 -0.8620097633 -0.6373311  0.17066179  1.26768382
## 453  0.825081288 -0.6776064140  1.6596029  1.52941294  0.80577843
## 343 -0.315284553  1.1738829960 -0.9818712  0.08166062 -1.18041474
## 448  0.995603282 -0.7584342534  1.6596029  1.52941294  0.80577843
## 210  1.116389695  0.0379716616 -0.6373311 -0.77868399  0.06672981
## 387  1.116389695 -1.1054905698  1.6596029  1.52941294  0.80577843
## 454  1.091521905 -0.6374774338  1.6596029  1.52941294  0.80577843
## 389  1.116389695 -1.0474104008  1.6596029  1.52941294  0.80577843
## 94  -1.409467353 -0.0613297558 -0.6373311 -0.82021787 -0.11803234
## 431  0.622586419 -0.8274371034  1.6596029  1.52941294  0.80577843
## 25   0.906789743  0.2871037683 -0.6373311 -0.60068166  1.17530274
## 182 -0.226471014 -0.5685220737 -0.7521778 -1.27709053 -0.30279450
## 91  -0.087921893 -0.3337319220 -0.8670245 -0.82021787 -0.30279450
## 175  0.004444187 -0.5191325596 -0.5224844 -0.66594918 -0.85708096
## 203 -1.878402839  1.1753551835 -0.8670245 -0.35741180 -1.73470120
## 252 -2.119975665  1.7104240829 -0.2927910 -0.46421320  0.29768250
## 402  1.116389695 -1.0547238481  1.6596029  1.52941294  0.80577843
## 107  0.828633829 -0.7522605641 -0.5224844 -0.14380900  1.12911220
## 336 -1.210525026  1.0401513886 -0.5224844 -1.09315478  0.80577843
## 139  1.052443947 -1.0098458762 -0.6373311  0.17066179  1.26768382
## 498  0.071942477 -0.4285217972 -0.4076377 -0.10227512  0.34387304
## 356 -1.743406260  3.2248775491 -0.6373311 -0.44047956  1.63720813
## 266 -0.205155765 -0.8588754287 -0.5224844 -0.85581834 -2.51994036
## 239 -1.778931675  1.1373157596 -0.4076377 -0.64221553 -0.85708096
## 495 -0.922769160 -0.6711952751 -0.4076377 -0.10227512  0.34387304
## 259  1.116389695 -0.9025186628 -0.5224844 -0.85581834 -2.51994036
## 380  1.116389695 -1.1440048928  1.6596029  1.52941294  0.80577843
## 134  0.952972784 -0.6293091680 -0.6373311  0.17066179  1.26768382
## 493  0.530220338 -0.8002728706 -0.6373311  1.79641644  0.75958789
## 221  0.707847416 -0.4432436716 -0.1779443 -0.60068166 -0.48755665
## 500  0.174966182 -0.6625521101 -0.4076377 -0.10227512  0.34387304
## 416  1.116389695 -0.9309651233  1.6596029  1.52941294  0.80577843
## 497  0.153650933 -0.4732098094 -0.4076377 -0.10227512  0.34387304
## 401  1.116389695 -1.0477428302  1.6596029  1.52941294  0.80577843
## 350 -1.210525026  2.3730983904 -0.9818712 -0.43454615  0.57482574
## 292 -1.452097852  0.6276539660 -0.6373311 -0.96855315  0.34387304
## 443  1.116389695 -0.8501847738  1.6596029  1.52941294  0.80577843
## 301 -0.752247165  1.9151531169 -0.5224844 -0.29807769 -1.68851066
## 373  0.746925373 -1.2658165310  1.6596029  1.52941294  0.80577843
## 200 -1.892613005  1.8323307009 -0.7521778 -0.03700760 -0.67231881
## 58  -0.997372532  2.1511780064 -0.5224844 -0.90328562 -1.54993904
## 101  0.402328842 -0.4830877123 -0.5224844 -0.14380900  1.12911220
## 479  0.999155824 -0.7714939807  1.6596029  1.52941294  0.80577843
## 439  0.686532167 -0.9376612017  1.6596029  1.52941294  0.80577843
## 323 -0.663433626  0.4397838527 -0.5224844 -0.71934988  0.52863520
## 208  0.146545850  0.2658757752 -0.6373311 -0.77868399  0.06672981
## 378  1.073759197 -1.1573495596  1.6596029  1.52941294  0.80577843
## 125  0.967182950 -0.8494724251 -0.8670245 -1.30675758  0.29768250
## 447  0.988498199 -0.8182715493  1.6596029  1.52941294  0.80577843
## 204 -1.256708066  0.6282713349 -0.6373311 -1.09315478 -1.73470120
## 32   1.116389695  0.1804414138 -0.6373311 -0.60068166  1.17530274
## 275 -1.267365691  0.1341862342 -0.6373311 -0.91515245 -0.39517558
## 445  0.995603282 -0.9020437636  1.6596029  1.52941294  0.80577843
## 108  0.590613545 -0.7943366310 -0.5224844 -0.14380900  1.12911220
## 462  0.704294875 -0.5831489682  1.6596029  1.52941294  0.80577843
## 230 -1.675907970 -0.1994304356 -0.1779443 -0.60068166 -0.48755665
## 360  0.452064424 -0.6106931203  1.6596029  1.52941294  0.80577843
## 446  0.931657534 -0.8582105699  1.6596029  1.52941294  0.80577843
## 74  -2.215894287  0.7086717651 -0.6373311 -0.61254848  0.34387304
## 64  -0.894348827  1.9878601804 -0.1779443 -0.73715011  0.57482574
## 183  0.839291454 -0.5197499285 -0.7521778 -1.27709053 -0.30279450
## 250 -1.814457091  1.9145357480 -0.2927910 -0.46421320  0.29768250
## 381  0.828633829 -1.1295679579  1.6596029  1.52941294  0.80577843
## 362  0.800213497 -0.7121315839  1.6596029  1.52941294  0.80577843
## 205 -1.302891107  0.6282713349 -0.6373311 -1.09315478 -1.73470120
## 136  1.052443947 -0.7998929513 -0.6373311  0.17066179  1.26768382
## 417  0.789555872 -0.9381835908  1.6596029  1.52941294  0.80577843
## 119  0.160756016 -0.6256999342 -0.4076377  0.14099473 -0.30279450
## 54  -1.675907970  1.4340327636 -0.6373311 -0.98041997 -0.76469989
## 368  1.116389695 -1.0848799457  1.6596029  1.52941294  0.80577843
## 166  0.867711786 -0.7178778639 -0.5224844 -0.03107419 -1.73470120
## 289 -0.816192913  1.6726695986 -0.4076377 -0.68374941 -0.85708096
## 341 -0.357915052  0.4830471675 -0.5224844 -1.09315478  0.80577843
## 351 -0.858823412  2.3730983904 -0.9818712 -0.43454615  0.57482574
## 397  0.974288033 -1.0059517029  1.6596029  1.52941294  0.80577843
## 244 -2.159053622  1.5388905012 -0.4076377 -0.64221553 -0.85708096
## 321 -0.578172628  0.3539695720 -0.5224844 -0.71934988  0.52863520
## 41  -1.874850298  0.7627152911 -0.7521778 -0.92701927 -0.07184181
## 177 -0.759352248 -0.1140435641 -0.5224844 -0.66594918 -0.85708096
## 287 -1.317101273  2.5141909351 -0.9818712 -0.99228679 -0.11803234
## 98   0.263779721 -0.1423950448 -0.8670245 -0.78461740 -0.21041342
## 277 -0.695406500  0.4711746882 -0.6373311 -0.91515245 -0.39517558
## 145  1.038233781 -1.1630958396 -0.5224844 -0.03107419 -1.73470120
## 11   0.913894827  1.2117799501 -0.5224844 -0.57694801 -1.50374851
## 285 -1.697223220  1.6679680968 -0.9818712 -0.73121670 -1.45755797
## 428  0.359698343 -0.9175729666  1.6596029  1.52941294  0.80577843
## 348 -1.452097852  2.2511442825 -0.6373311 -0.33961157 -0.25660396
## 17  -1.395257187  0.3341187865 -0.6373311 -0.60068166  1.17530274
## 153  0.690084708 -1.0375799879 -0.5224844 -0.03107419 -1.73470120
## 31   0.906789743  0.2079855659 -0.6373311 -0.60068166  1.17530274
## 78  -0.809087830  0.1403124336 -0.5224844 -0.06074124  0.11292035
## 396  1.073759197 -0.9827291333  1.6596029  1.52941294  0.80577843
## 248  0.377461051  2.0232876588 -0.2927910 -0.46421320  0.29768250
## 120 -0.119894767 -0.4919208369 -0.4076377  0.14099473 -0.30279450
## 332 -1.427230061  1.3514003073 -0.9818712 -0.61848189 -0.71850935
## 167  0.981393116 -0.8306664178 -0.5224844 -0.03107419 -1.73470120
## 357  1.024023615 -0.7944316108  1.6596029  1.52941294  0.80577843
## 322 -0.507121797  0.3539695720 -0.5224844 -0.71934988  0.52863520
## 46  -1.235392817  0.6199131095 -0.7521778 -1.03975408 -0.25660396
## 419  1.116389695 -0.9462093868  1.6596029  1.52941294  0.80577843
## 131  1.077311738 -0.7961887377 -0.6373311  0.17066179  1.26768382
## 75  -2.222999370  0.2167712006 -0.5224844 -0.06074124  0.11292035
## 65  -0.322389636  2.5776849546 -0.7521778 -1.14062207  0.06672981
## 283 -0.670538709  0.6728643674 -0.5224844 -1.14062207 -1.64232012
## 151  1.020471073 -1.0338757744 -0.5224844 -0.03107419 -1.73470120
## 95   0.309962761 -0.0855021237 -0.6373311 -0.82021787 -0.11803234
## 319 -0.048843936 -0.1246813056 -0.6373311 -0.61848189 -0.02565127
## 365  0.508905089 -0.8977221812  1.6596029  1.52941294  0.80577843
## 104  0.668769459 -0.5130538501 -0.5224844 -0.14380900  1.12911220
## 264  0.920999910 -0.8150422349 -0.5224844 -0.85581834 -2.51994036
## 444  1.116389695 -0.8627221120  1.6596029  1.52941294  0.80577843
## 337 -0.791325122  0.6819824315 -0.5224844 -1.09315478  0.80577843
## 421  1.116389695 -0.9194725633  1.6596029  1.52941294  0.80577843
## 372  1.116389695 -1.2470580136  1.6596029  1.52941294  0.80577843
## 106  0.999155824 -0.8016975682 -0.5224844 -0.14380900  1.12911220
## 176 -1.260260608 -0.3147359550 -0.5224844 -0.66594918 -0.85708096
## 189 -1.402362270  0.3664594203 -0.5224844 -0.06074124 -1.50374851
## 238  0.107467893  0.1676191361 -0.1779443 -0.60068166 -0.48755665
## 100 -0.215813389 -0.1423950448 -0.8670245 -0.78461740 -0.21041342
## 391  1.009813449 -0.8873693792  1.6596029  1.52941294  0.80577843
## 195 -1.768274051  1.1514202651 -0.9818712 -0.84988492 -1.31898635
## 328 -0.883691203  0.7697437989 -0.5224844 -0.71934988  0.52863520
## 354 -1.153684361  3.9566021965 -0.5224844 -1.31269099 -0.67231881
## 92   0.189176348 -0.3338269018 -0.8670245 -0.82021787 -0.30279450
## 126  0.704294875 -0.8558360740 -0.8670245 -1.30675758  0.29768250
## 45  -1.015135240  0.9145880470 -0.7521778 -1.03975408 -0.25660396
## 307  0.118125517 -0.3304551177 -0.2927910 -1.10502160 -0.02565127
## 229 -1.832219799 -0.1994304356 -0.1779443 -0.60068166 -0.48755665
## 290 -1.622619847  1.6726695986 -0.4076377 -0.68374941 -0.85708096
## 379  0.981393116 -1.1440048928  1.6596029  1.52941294  0.80577843
## 455  0.906789743 -0.6168668096  1.6596029  1.52941294  0.80577843
## 172  1.020471073 -0.6678709809 -0.5224844 -0.03107419 -1.73470120
## 465 -0.112789684 -0.3949464255  1.6596029  1.52941294  0.80577843
## 261  0.469827132 -0.7992280924 -0.5224844 -0.85581834 -2.51994036
## 14  -0.240681180  0.4333252240 -0.6373311 -0.60068166  1.17530274
## 371  1.027576156 -1.2312438711  1.6596029  1.52941294  0.80577843
## 201 -1.942348587  1.8323307009 -0.7521778 -0.03700760 -0.67231881
## 73  -2.159053622  0.7086717651 -0.6373311 -0.61254848  0.34387304
## 181  0.523115255 -0.5005640019 -0.7521778 -1.27709053 -0.30279450
## 317  0.519562713  0.0966691995 -0.6373311 -0.61848189 -0.02565127
## 164  0.899684660 -0.7755306237 -0.5224844 -0.03107419 -1.73470120
## 286 -1.302891107  1.6679680968 -0.9818712 -0.64221553 -1.45755797
## 310  0.288647512 -0.3288879504 -0.6373311 -0.61848189 -0.02565127
## 33   0.476932215  0.0925850666 -0.6373311 -0.60068166  1.17530274
## 369  1.116389695 -1.1694594886  1.6596029  1.52941294  0.80577843
## 128  0.974288033 -0.9530004450 -0.6373311  0.17066179  1.26768382
## 209 -0.336599802  0.2109299408 -0.6373311 -0.77868399  0.06672981
## 399  1.116389695 -1.0948528283  1.6596029  1.52941294  0.80577843
## 309  0.494694923 -0.2267846280 -0.6373311 -0.61848189 -0.02565127
## 427 -0.315284553 -0.8536040479  1.6596029  1.52941294  0.80577843
## 63  -0.027528687  1.6291213443 -0.1779443 -0.73715011  0.57482574
## 338 -0.318837095  0.8642962245 -0.5224844 -1.09315478  0.80577843
## 480  0.690084708 -0.8756393696  1.6596029  1.52941294  0.80577843
## 467  0.572850837 -0.4385896596  1.6596029  1.52941294  0.80577843
## 199 -1.075528447  1.6687754254 -0.8670245 -0.47014661 -2.70470251
## 276 -0.915664077  0.2242746075 -0.6373311 -0.91515245 -0.39517558
## 473  0.228254306 -0.4267171803  1.6596029  1.52941294  0.80577843
## 324  0.203386515  0.4397838527 -0.5224844 -0.71934988  0.52863520
## 115  0.555088129 -0.7306526517 -0.4076377  0.14099473 -0.30279450
## 171  0.924552451 -0.6502047316 -0.5224844 -0.03107419 -1.73470120
## 48   0.601271169  0.8996287230 -0.7521778 -1.03975408 -0.25660396
## 429  0.338383094 -0.8830477967  1.6596029  1.52941294  0.80577843
## 359  0.526667797 -0.5092546567  1.6596029  1.52941294  0.80577843
## 89   0.629691502 -0.1773001341 -0.8670245 -0.82021787 -0.30279450
## 469  0.086152643 -0.4210658801  1.6596029  1.52941294  0.80577843
## 299 -1.722091011  1.9151531169 -0.5224844 -0.29807769 -1.68851066
## 96  -0.382782843 -0.1423950448 -0.8670245 -0.78461740 -0.21041342
## 314  0.505352547 -0.2527616128 -0.6373311 -0.61848189 -0.02565127
## 102  0.096810268 -0.4459031069 -0.5224844 -0.14380900  1.12911220
## 110  0.803766038 -0.5935967501 -0.5224844 -0.14380900  1.12911220
## 297 -0.624355669  1.0283263992 -0.6373311 -0.70748306 -1.13422420
## 406  1.116389695 -1.1253413553  1.6596029  1.52941294  0.80577843
## 433  0.221149222 -0.7572944954  1.6596029  1.52941294  0.80577843
## 302 -1.000925074  0.8057411563 -0.2927910 -0.47014661 -1.08803366
## 142  1.116389695 -1.1186927669 -0.6373311  0.17066179  1.26768382
## 430  0.960077867 -0.8675660836  1.6596029  1.52941294  0.80577843
## 59  -1.398809729  1.9089794276 -0.1779443 -0.73715011  0.57482574
## 184  0.960077867 -0.4502246894 -0.7521778 -1.27709053 -0.30279450
## 66  -1.803799466  1.3375332514 -0.6373311 -0.42267932 -1.08803366
## 156  0.498247464 -0.9733261297 -0.5224844 -0.03107419 -1.73470120
## 452  1.052443947 -0.6837801032  1.6596029  1.52941294  0.80577843
## 494 -0.517779422 -0.6711952751 -0.4076377 -0.10227512  0.34387304
## 240 -0.936979326  1.1373157596 -0.4076377 -0.64221553 -0.85708096
## 288 -1.324206356  1.6726695986 -0.4076377 -0.68374941 -0.85708096
## 334 -1.082633530  1.2648261879 -0.5224844 -1.09315478  0.80577843
## 235 -0.073711727 -0.0679783442 -0.1779443 -0.60068166 -0.48755665
## 327 -1.409467353  0.7697437989 -0.5224844 -0.71934988  0.52863520
## 7   -0.070159185  0.8384142195 -0.5224844 -0.57694801 -1.50374851
## 212  0.711399958 -0.0617571650 -0.6373311 -0.77868399  0.06672981
## 502  0.018654354 -0.6251775451 -0.9818712 -0.80241764  1.17530274
## 335 -1.068423364  1.2648261879 -0.5224844 -1.09315478  0.80577843
## 342 -0.684748875  1.5400302593 -0.9818712 -0.73715011 -1.36517689
## 409  1.041786323 -1.1114268095  1.6596029  1.52941294  0.80577843
## 407  1.116389695 -1.2427839210  1.6596029  1.52941294  0.80577843
## 300 -2.080897708  1.9151531169 -0.5224844 -0.29807769 -1.68851066
## 506  0.434301716 -0.6126402069 -0.9818712 -0.80241764  1.17530274
## 442  1.016918532 -0.8215483536  1.6596029  1.52941294  0.80577843
## 13  -1.050660656  0.7863652700 -0.5224844 -0.57694801 -1.50374851
## 10   0.615481336  1.3283202075 -0.5224844 -0.57694801 -1.50374851
## 53  -1.686565595  1.4340327636 -0.6373311 -0.98041997 -0.76469989
## 215 -2.088002791 -0.0985618510 -0.6373311 -0.77868399  0.06672981
## 404  0.974288033 -0.9936043244  1.6596029  1.52941294  0.80577843
## 133  1.041786323 -0.6969823003 -0.6373311  0.17066179  1.26768382
## 311 -1.093291155 -0.6058016588 -0.6373311 -0.61848189 -0.02565127
## 258  0.651006751 -0.9469692255 -0.5224844 -0.85581834 -2.51994036
## 273 -0.350809969  0.0581548764 -0.7521778 -1.09908819  0.06672981
## 375  1.116389695 -1.2623022771  1.6596029  1.52941294  0.80577843
## 487  0.398776300 -0.1183176566  1.6596029  1.52941294  0.80577843
## 180 -0.361467593 -0.4587728745 -0.7521778 -1.27709053 -0.30279450
## 87  -0.833955621  0.3002109855 -0.7521778 -0.95668632  0.02053927
## 202 -1.071975905  1.1753551835 -0.8670245 -0.35741180 -1.73470120
## 186  0.007996729 -0.2447358168 -0.7521778 -1.27709053 -0.30279450
## 304 -1.807352008  0.8057411563 -0.2927910 -0.47014661 -1.08803366
## 316  0.324172928  0.0712146037 -0.6373311 -0.61848189 -0.02565127
## 260  1.116389695 -0.8473828687 -0.5224844 -0.85581834 -2.51994036
## 47  -1.253155525  0.6199131095 -0.7521778 -1.03975408 -0.25660396
## 161  0.853501620 -0.9482039634 -0.5224844 -0.03107419 -1.73470120
## 339 -1.111053862  0.4830471675 -0.5224844 -1.09315478  0.80577843
## 413  1.116389695 -1.0643168114  1.6596029  1.52941294  0.80577843
## 155  0.974288033 -0.9714740229 -0.5224844 -0.03107419 -1.73470120
## 457  0.686532167 -0.5767378294  1.6596029  1.52941294  0.80577843
## 168  0.377461051 -0.6502047316 -0.5224844 -0.03107419 -1.73470120
## 331 -1.292233482  0.9871051509 -0.6373311  0.12912791 -0.71850935
## 113  0.864159245 -0.6846349217 -0.4076377  0.14099473 -0.30279450
## 474 -0.034633770 -0.5993905200  1.6596029  1.52941294  0.80577843
## 377  0.878369411 -1.1635707388  1.6596029  1.52941294  0.80577843
## 247 -1.196314860  2.0232876588 -0.2927910 -0.46421320  0.29768250
## 466 -0.723826832 -0.3459843207  1.6596029  1.52941294  0.80577843
## 141  0.889027036 -1.0367726593 -0.6373311  0.17066179  1.26768382
## 325 -1.011582699  0.4397838527 -0.5224844 -0.71934988  0.52863520
## 169  0.977840575 -0.8049743725 -0.5224844 -0.03107419 -1.73470120
## 246  0.057732311  1.9755128019 -0.2927910 -0.46421320  0.29768250
## 256 -1.757616426  2.5764502168 -0.9818712 -0.55321437 -0.94946204
## 282 -1.114606404  0.6884410603 -0.5224844 -1.14062207 -1.64232012
## 499 -0.116342226 -0.6581830377 -0.4076377 -0.10227512  0.34387304
## 67  -1.331311439  1.3375332514 -0.6373311 -0.42267932 -1.08803366
## 265  0.817976204 -0.8856597421 -0.5224844 -0.85581834 -2.51994036
## 471  0.547983046 -0.3617034834  1.6596029  1.52941294  0.80577843
## 451  0.853501620 -0.6987869171  1.6596029  1.52941294  0.80577843
## 370  1.002708366 -1.1579669285  1.6596029  1.52941294  0.80577843
##           black        lstat         medv    crime
## 140  0.44061589  0.813175569 -0.514597451 med_high
## 80   0.43141494 -0.497553933 -0.242772758  med_low
## 228  0.16874956 -0.881250390  0.985874857 med_high
## 30   0.25802074 -0.094252548 -0.166661844 med_high
## 306  0.40184044 -0.521359918  0.637939249      low
## 305  0.40534556 -0.801430324  1.475159305      low
## 28  -0.55089661  0.647934029 -0.840787084 med_high
## 492  0.36624150  0.758561840 -0.971262937  med_low
## 329  0.28222802 -0.375723306 -0.351502635      low
## 174  0.42528097 -0.505956045  0.116035838  med_low
## 97   0.38508156 -0.183875078 -0.123169893  med_low
## 278  0.40282626 -1.189327837  1.148969673      low
## 23   0.44061589  0.849584722 -0.797295133 med_high
## 72   0.22198366 -0.388326475 -0.090550930  med_low
## 162  0.19449033 -1.529613381  2.986504601 med_high
## 383  0.44061589  1.532956514 -1.221341655     high
## 197  0.44061589 -1.200530653  1.170715648      low
## 196  0.41137000 -1.355969729  2.986504601      low
## 353  0.39055831 -0.681000049 -0.427613550      low
## 488  0.34553935 -0.168471205 -0.210153795     high
## 464  0.40687906 -0.330912041 -0.253645746     high
## 268  0.30523040 -0.730012370  2.986504601 med_high
## 333  0.06107647 -0.675398641 -0.340629648      low
## 262  0.34718238 -0.755218707  2.236268447 med_high
## 60   0.44061589 -0.480749709 -0.318883672  med_low
## 434 -2.80940262  0.499496714 -0.895152022     high
## 303  0.29504363 -0.557769070  0.420479494  med_low
## 472  0.42341887  0.030378783 -0.318883672     high
## 270  0.37971433  0.139606242 -0.199280807  med_low
## 425 -3.86685532  0.631129805 -1.177849704     high
## 118  0.41443699 -0.329511689 -0.362375623  med_low
## 241  0.37872851 -0.178273670 -0.057931966  med_low
## 423 -0.71333730  0.202622083 -0.188407819     high
## 315  0.42736214 -0.472347596  0.137781813 med_high
## 132  0.44061589 -0.055042691 -0.318883672 med_high
## 211  0.40063555  0.646533677 -0.090550930  med_low
## 68   0.43305797 -0.637589136 -0.057931966      low
## 43   0.29241479 -0.958269752  0.300876629  med_low
## 345  0.34280097 -1.126311996  0.942382906      low
## 194  0.40194997 -1.067497210  0.931509918      low
## 388  0.44061589  2.707851869 -1.645388177     high
## 220  0.40600278 -0.301504649  0.050797911  med_low
## 269  0.36832267 -1.329363040  2.279760398 med_high
## 18   0.32943768  0.282442149 -0.547216415 med_high
## 20   0.37544246 -0.192277190 -0.471105500 med_high
## 61   0.42100910  0.069588640 -0.416740562  med_low
## 148  0.38376713  2.363365269 -0.862533059 med_high
## 313  0.43404378 -0.130661701 -0.340629648 med_high
## 52   0.40852209 -0.451342316 -0.221026782      low
## 42   0.31475997 -1.094103899  0.442225470  med_low
## 481  0.44061589 -0.267896200  0.050797911     high
## 123  0.23458021  0.738956911 -0.221026782  med_low
## 37   0.22877484 -0.174072614 -0.275391721  med_low
## 418 -2.51179552  1.958663532 -1.319198544     high
## 231  0.23742812 -0.140464165  0.192146752 med_high
## 352  0.15450999 -1.003081017  0.170400776      low
## 281  0.33557165 -1.245341918  2.486347165      low
## 255  0.39669229 -0.851842997 -0.068804954      low
## 384  0.44061589  1.667390309 -1.112611777     high
## 56   0.42999098 -1.098304955  1.399048391      low
## 85   0.44061589 -0.424735627  0.148654801      low
## 86   0.39022971 -0.857444405  0.442225470      low
## 111  0.40326440  0.048583360 -0.090550930  med_low
## 84   0.37204687 -0.720209906  0.039924923      low
## 193  0.37040384 -1.369973249  1.507778268  med_low
## 426 -3.82271264  1.643584324 -1.547531287     high
## 485  0.15396231  0.096195329 -0.210153795 med_high
## 160  0.08364072 -0.737014131  0.083416874 med_high
## 187  0.39384437 -1.148717628  2.986504601      low
## 284  0.42550004 -1.329363040  2.986504601      low
## 188  0.40742673 -0.836439125  1.029366808      low
## 5    0.44061589 -1.025486649  1.486032293      low
## 398  0.39899252  1.017626966 -1.525785311     high
## 420 -3.37613768  1.412526239 -1.536658299     high
## 344  0.44061589 -0.766421523  0.148654801      low
## 44   0.41388931 -0.730012370  0.235638703  med_low
## 349  0.37533292 -0.933063415  0.213892727      low
## 51   0.42593818  0.111599201 -0.308010684  med_low
## 222  0.42243305  1.233281179 -0.090550930 med_high
## 484  0.39702089 -0.312707465 -0.079677942 med_high
## 122  0.22997973  0.226428068 -0.242772758      low
## 496  0.40107369  0.692745294  0.061670899  med_low
## 477  0.43305797  0.843983314 -0.634200317     high
## 137  0.23633277  0.594720652 -0.558089402 med_high
## 19  -0.74137830 -0.134862757 -0.253645746 med_high
## 456 -3.34908249  0.766963952 -0.916897998     high
## 50   0.44061589  0.496696010 -0.340629648  med_low
## 296  0.44061589 -0.893853558  0.659685225  med_low
## 440  0.44061589  1.432131167 -1.058246839     high
## 219  0.44061589  0.737556559 -0.112296905  med_low
## 69   0.44061589  0.061186528 -0.558089402  med_low
## 400 -0.20279379  2.424980758 -1.764991042     high
## 93   0.41991374 -0.629187024  0.039924923      low
## 312  0.44061589 -0.934463767 -0.047058979 med_high
## 138  0.40972697  0.271239333 -0.590708366 med_high
## 62   0.23447067  0.250234052 -0.710311231  med_low
## 340  0.44061589 -0.407931403 -0.384121599      low
## 192  0.36186010 -1.115109179  0.866271992      low
## 482  0.39866392 -0.688001809  0.126908825     high
## 77   0.18605612 -0.095652900 -0.275391721  med_low
## 38   0.44061589 -0.543765550 -0.166661844      low
## 173  0.44061589  0.285242853  0.061670899  med_low
## 236  0.21990249 -0.248291271  0.159527789 med_high
## 330  0.20303408 -0.744015891  0.007305960      low
## 124  0.14936183  1.786420232 -0.568962390  med_low
## 218  0.39548740 -0.414933163  0.670558212      low
## 435 -2.80458308  0.352459751 -1.177849704     high
## 116 -0.12885754  0.435080520 -0.460232513  med_low
## 392  0.23775673  0.855186130  0.072543887     high
## 253  0.32220836 -1.277550015  0.768415102  med_low
## 437 -3.60572343  0.755761136 -1.406182446     high
## 361  0.19591429 -0.681000049  0.268257666     high
## 410 -1.94221255  0.998022037  0.540082359     high
## 438 -3.80474886  1.932056843 -1.504039336     high
## 254  0.44061589 -1.276149663  2.203649484 med_high
## 207  0.41838025 -0.235688103  0.203019739  med_low
## 39   0.40260719 -0.353317674  0.235638703  med_low
## 79   0.32560395 -0.043839875 -0.144915868      low
## 40   0.42670493 -1.166922204  0.898890955      low
## 504  0.44061589 -0.982075736  0.148654801      low
## 214  0.31914137 -0.458344076  0.605320286  med_low
## 412 -3.52291483  1.199672730 -0.579835378     high
## 432 -3.01598599  0.985418869 -0.916897998     high
## 271  0.35024937  0.048583360 -0.155788856 med_high
## 272  0.44061589 -0.849042293  0.290003641  med_low
## 82   0.42670493 -0.760820115  0.148654801      low
## 291  0.44061589 -1.305557056  0.648812237      low
## 234  0.24400024 -1.218735230  2.801663810 med_high
## 76   0.29088130 -0.519959566 -0.123169893  med_low
## 242  0.41564187 -0.035437762 -0.264518733  med_low
## 147 -2.05273356  0.559711851 -0.753803182 med_high
## 415 -2.93996857  3.406627533 -1.688880128     high
## 486  0.34992076 -0.290301832 -0.144915868 med_high
## 117  0.40118323 -0.085850436 -0.144915868  med_low
## 411 -3.87835651 -0.356118378 -0.819041108     high
## 491 -0.41890671  2.384370549 -1.569277262  med_low
## 346  0.31727927 -0.297303592 -0.547216415      low
## 267  0.30008225  0.299246373  0.888017967 med_high
## 436 -2.70359163  1.486744897 -0.993008912     high
## 501  0.44061589  0.234830180 -0.623327329  med_low
## 163  0.36076474 -1.503006692  2.986504601 med_high
## 395  0.44061589  0.517701290 -1.069119826     high
## 318  0.44061589  0.460286857 -0.297137697  med_low
## 55   0.44061589  0.300646725 -0.394994586      low
## 405 -0.29808940  2.062289582 -1.525785311     high
## 9    0.32812326  2.419379350 -0.655946292  med_low
## 88   0.42144724 -0.589977167 -0.036185991      low
## 135 -1.02868910  0.652135085 -0.753803182 med_high
## 178  0.42637632 -0.891052854  0.224765715      low
## 232  0.21322085 -1.036689465  0.996747845 med_high
## 99   0.40370254 -1.271948607  2.312379361      low
## 22   0.39274902  0.164812578 -0.318883672 med_high
## 4    0.41575141 -1.360170785  1.181588636      low
## 83   0.44061589 -0.830837717  0.246511690      low
## 81   0.44061589 -1.031088057  0.594447298      low
## 154 -1.03756145  0.439281577 -0.340629648 med_high
## 293  0.44061589 -1.113708827  0.583574310      low
## 249  0.19755732 -0.438739148  0.213892727  med_low
## 326  0.40534556 -1.060495450  0.224765715  med_low
## 35  -1.18696744  1.076441751 -0.982135924 med_high
## 424 -3.87923279  1.489545601 -0.993008912     high
## 71   0.29635805 -0.830837717  0.181273764  med_low
## 34   0.02295823  0.797771697 -1.025627875 med_high
## 363  0.26415471 -0.344915562 -0.188407819     high
## 130  0.44061589  0.796371345 -0.895152022 med_high
## 453  0.31125484  0.646533677 -0.699438243     high
## 343  0.36459848 -0.560569774 -0.655946292      low
## 448  0.34882541  0.530304459 -1.079992814     high
## 210  0.44061589  1.461538560 -0.275391721 med_high
## 387  0.44061589  2.188321265 -1.308325557     high
## 454  0.21026340  0.572315020 -0.514597451     high
## 389  0.17795052  2.516003640 -1.340944520     high
## 94   0.43437239 -0.902255670  0.268257666      low
## 431 -2.99276453  0.698346703 -0.873406047     high
## 25   0.41246535  0.510699530 -0.753803182 med_high
## 182  0.44061589 -0.448541612  1.486032293      low
## 91   0.38891529 -0.538164142  0.007305960      low
## 175  0.40041648 -0.421934923  0.007305960  med_low
## 203  0.42396655 -1.336364800  2.149284545      low
## 252  0.22340762 -1.269147903  0.246511690  med_low
## 402  0.44061589  1.073641047 -1.667134152     high
## 107  0.42714307  0.841182610 -0.329756660  med_low
## 336  0.44061589 -0.650192305 -0.155788856      low
## 139  0.38738179  1.213676250 -1.003881900  med_low
## 498  0.44061589  0.202622083 -0.460232513 med_high
## 356  0.21212550 -0.991878200 -0.210153795  med_low
## 266  0.39132506 -0.308506409  0.029051936 med_high
## 239  0.24903885 -0.881250390  0.126908825  med_low
## 495  0.44061589  0.131204129  0.213892727 med_high
## 259  0.29153851 -0.681000049  1.464286318 med_high
## 380  0.40600278  1.278092444 -1.340944520     high
## 134  0.35068751  0.332854822 -0.449359525 med_high
## 493  0.44061589  0.097595681 -0.264518733  med_low
## 221  0.38365760 -0.412132459  0.453098458 med_high
## 500  0.42823842  0.342657286 -0.547216415  med_low
## 416 -3.60835228  2.296148371 -1.667134152     high
## 497  0.44061589  1.188469914 -0.308010684 med_high
## 401  0.44061589  1.976868108 -1.841101956     high
## 350  0.36339359 -0.947066935  0.442225470      low
## 292  0.44061589 -1.273348959  1.605635158      low
## 443  0.42736214  0.551309739 -0.449359525     high
## 301  0.37445664 -0.921860599  0.246511690      low
## 373 -0.09632559 -0.528361678  2.986504601     high
## 200  0.44061589 -1.133313756  1.344683452      low
## 58   0.39680182 -1.218735230  0.985874857      low
## 101  0.41717537 -0.452742668  0.540082359  med_low
## 479  0.25221537  0.752960432 -0.862533059     high
## 439 -3.15159055  2.992123331 -1.536658299     high
## 323  0.44061589 -0.693603218 -0.231899770 med_high
## 208  0.35879311  0.757161488 -0.003567028  med_low
## 378  0.44061589  1.202473434 -1.003881900     high
## 125  0.24871025  0.689944590 -0.405867574  med_low
## 447 -0.42350719  0.719351983 -0.829914096     high
## 204  0.39548740 -1.238340158  2.823409785      low
## 32   0.21968342  0.054184768 -0.873406047 med_high
## 275  0.44061589 -1.277550015  1.072858759      low
## 445 -1.27229535  1.559563202 -1.275706593     high
## 108  0.33973399  0.201221731 -0.231899770  med_low
## 462  0.38070015  0.279641445 -0.525470439     high
## 230  0.25922563 -1.245341918  0.975001869 med_high
## 360  0.37314222  0.002371742  0.007305960     high
## 446 -3.43517715  1.586169891 -1.166976716     high
## 74   0.22450297 -0.716008850  0.094289862  med_low
## 64   0.42615725 -0.441539852  0.268257666  med_low
## 183  0.41016511 -1.096904603  1.670873085  med_low
## 250  0.40600278 -0.853243349  0.398733519  med_low
## 381  0.44061589  0.638131565 -1.319198544     high
## 362 -0.06598434  0.215225251 -0.286264709     high
## 205  0.37106105 -1.368572897  2.986504601      low
## 136  0.41618955  0.603122764 -0.481978488 med_high
## 417 -3.67056826  1.839633609 -1.634515189     high
## 119 -0.19764564  0.380466791 -0.231899770  med_low
## 54   0.44061589 -0.591377519  0.094289862      low
## 368 -2.46732424  0.094794977  0.061670899     high
## 166 -1.27623862 -0.398128939  0.268257666 med_high
## 289  0.44061589 -0.707606738 -0.025313003      low
## 341  0.44061589 -0.470947244 -0.416740562      low
## 351  0.44061589 -0.934463767  0.039924923      low
## 397  0.44061589  0.940607604 -1.090865802     high
## 244  0.19755732 -1.045091578  0.126908825  med_low
## 321  0.44061589 -0.763620819  0.137781813  med_low
## 41   0.42659539 -1.494604580  1.344683452      low
## 177  0.40041648 -0.356118378  0.072543887      low
## 287 -0.16511369  0.038780895 -0.264518733      low
## 98   0.44061589 -1.182326077  1.757856987  med_low
## 277  0.35682148 -0.924661303  1.159842661  med_low
## 145  0.44061589  2.329756820 -1.166976716 med_high
## 11   0.39263948  1.091845624 -0.819041108  med_low
## 285  0.41673722 -0.672597937  1.051112783      low
## 428 -3.70069044  0.261436868 -1.264833606     high
## 348  0.39165367 -0.881250390  0.061670899      low
## 17   0.33053303 -0.850442645  0.061670899 med_high
## 153 -0.14671178 -0.074647619 -0.786422145 med_high
## 31   0.03829315  1.392921311 -1.069119826 med_high
## 78   0.33173792 -0.333712745 -0.188407819  med_low
## 396  0.38672458  0.625528397 -1.025627875     high
## 248  0.21322085 -0.350516970 -0.221026782  med_low
## 120  0.38146689  0.134004834 -0.351502635  med_low
## 332  0.40906976 -0.031236706 -0.590708366      low
## 167  0.13829878 -1.253744030  2.986504601 med_high
## 357  0.23063694  0.692745294 -0.514597451     high
## 322  0.44061589 -0.809832436  0.061670899  med_low
## 46   0.44061589 -0.342114857 -0.351502635  med_low
## 419 -3.72665028  1.115651608 -1.493166348     high
## 131  0.42024235 -0.007430722 -0.362375623 med_high
## 75   0.41892793 -0.822435605  0.170400776      low
## 65   0.40052602 -0.644590896  1.138096685      low
## 283  0.22340762 -1.350368321  2.551585092      low
## 151  0.17663610  0.202622083 -0.112296905 med_high
## 95   0.44061589 -0.288901480 -0.210153795      low
## 319  0.42210445 -0.321109577  0.061670899 med_high
## 365 -0.02326562 -1.031088057 -0.068804954 med_high
## 104  0.41399884  0.110198849 -0.351502635  med_low
## 264  0.40249765 -0.196478246  0.920636930 med_high
## 444  0.32921861  0.867789298 -0.775549157     high
## 337  0.44061589 -0.399529291 -0.329756660      low
## 421 -0.41540159  0.331454470 -0.634200317     high
## 372  0.10379520 -0.437338796  2.986504601     high
## 106  0.40939837  0.534505515 -0.329756660  med_low
## 176  0.37555199 -1.025486649  0.746669127      low
## 189  0.28660942 -1.133313756  0.790161078  med_low
## 238  0.36580336 -1.109507771  0.975001869 med_high
## 100  0.44061589 -0.905056374  1.159842661      low
## 391  0.41356070  0.624128045 -0.808168120     high
## 195  0.21935482 -1.158520092  0.714050163      low
## 328  0.44061589  0.019175967 -0.036185991  med_low
## 354  0.30435412 -1.141715868  0.822780041      low
## 92   0.40392161 -0.623585616 -0.057931966      low
## 126  0.31048809  0.302047077 -0.123169893  med_low
## 45   0.35835497 -0.434538092 -0.144915868  med_low
## 307  0.44061589 -0.865846518  1.181588636      low
## 229  0.22822717 -1.222936286  2.627696006 med_high
## 290  0.16480630 -0.440139500  0.246511690      low
## 379  0.44061589  1.545559682 -1.025627875     high
## 455 -3.83366615  0.848184370 -0.829914096     high
## 172 -0.09358721 -0.087250788 -0.373248611 med_high
## 465  0.44061589  0.079391104 -0.123169893     high
## 261  0.39570647 -0.428936683  1.225080587 med_high
## 14   0.44061589 -0.615183504 -0.231899770 med_high
## 371  0.38749133 -1.357370081  2.986504601     high
## 201  0.30260156 -1.148717628  1.127223698      low
## 73   0.37500432 -0.998879961  0.029051936  med_low
## 181  0.42593818 -0.713208146  1.877459852      low
## 317  0.37270408  0.794970993 -0.514597451 med_high
## 164  0.34805866 -1.306957408  2.986504601 med_high
## 286  0.41673722 -0.619384560 -0.057931966      low
## 310  0.43338657 -0.375723306 -0.242772758 med_high
## 33  -1.35904722  2.108501199 -1.014754888 med_high
## 369  0.20642967 -1.315359520  2.986504601     high
## 128  0.38814854  0.635330861 -0.688565255 med_high
## 209  0.26996007  0.281041797  0.203019739  med_low
## 399  0.44061589  2.511802584 -1.906339882     high
## 309  0.44061589 -1.136114460  0.029051936 med_high
## 427 -3.63683142  0.425278056 -1.340944520     high
## 63   0.44061589 -0.829437365 -0.036185991  med_low
## 338  0.41772304 -0.293102536 -0.438486537      low
## 480  0.29186711  0.063987232 -0.123169893     high
## 467 -3.66574871  0.629729453 -0.384121599     high
## 199  0.38913436 -0.844841237  1.312064489      low
## 276  0.44061589 -1.354569377  1.029366808  med_low
## 473  0.40194997  0.239031236  0.072543887 med_high
## 324  0.37741409 -0.127860997 -0.438486537 med_high
## 115  0.35123518 -0.308506409 -0.438486537  med_low
## 171 -0.70523169  0.248833700 -0.558089402 med_high
## 48   0.39504926  0.860787538 -0.645073304  med_low
## 429 -2.84730180  1.241683291 -1.253960618     high
## 359  0.42451422 -0.164270149  0.018178948     high
## 89   0.44061589 -1.001680665  0.116035838      low
## 469  0.13216481  0.766963952 -0.373248611     high
## 299  0.12668805 -1.075899322 -0.003567028      low
## 96   0.01430495 -0.840640181  0.637939249  med_low
## 314  0.40216904 -0.665596177 -0.101423917 med_high
## 102  0.42615725 -0.697804274  0.431352482  med_low
## 110  0.37850944  0.405673128 -0.340629648 med_high
## 297  0.39625414 -0.737014131  0.496590409      low
## 406  0.30994042  1.446134688 -1.906339882     high
## 433 -2.83393851 -0.087250788 -0.699438243     high
## 302  0.42801935 -0.441539852 -0.057931966      low
## 142  0.44061589  3.046737061 -0.884279035 med_high
## 430 -3.24173801  1.600173411 -1.417055434     high
## 59   0.37248501 -0.811232788  0.083416874  med_low
## 184  0.44061589 -0.976474328  1.083731747  med_low
## 66   0.44061589 -1.117909883  0.105162850      low
## 156 -2.94281648  0.331454470 -0.753803182 med_high
## 452 -0.01516002  0.710949871 -0.797295133     high
## 494  0.44061589 -0.090051492 -0.079677942  med_low
## 240  0.29690573 -0.739814835  0.083416874  med_low
## 288  0.44061589 -0.772022931  0.072543887      low
## 334  0.36186010 -0.976474328 -0.036185991      low
## 235  0.03862176 -0.644590896  0.703177176 med_high
## 327  0.44061589 -0.910657783  0.050797911 med_high
## 7    0.42637632 -0.031236706  0.039924923  med_low
## 212  0.42243305  1.586169891 -0.351502635 med_high
## 502  0.38683412 -0.417733867 -0.014440015      low
## 335  0.35846451 -0.826636661 -0.199280807      low
## 342  0.41695629 -1.003081017  1.105477722      low
## 409 -0.46042055  1.925055083 -0.579835378     high
## 407  0.14837602  1.496547361 -1.156103728     high
## 300  0.16327280 -1.108107419  0.703177176      low
## 506  0.44061589 -0.668396881 -1.156103728      low
## 442  0.32078440  0.961612885 -0.590708366     high
## 13   0.37051338  0.428078760 -0.090550930  med_low
## 10   0.32899954  0.622727693 -0.394994586  med_low
## 53   0.44061589 -1.032488409  0.268257666      low
## 215 -0.08482439  2.366165973  0.126908825 med_high
## 404  0.44061589  0.996621685 -1.547531287     high
## 133  0.31859370 -0.214682823  0.050797911 med_high
## 311 -0.06817505 -0.001829314 -0.699438243 med_high
## 258  0.36175056 -1.054894042  2.986504601 med_high
## 273  0.41936607 -0.689402161  0.203019739  med_low
## 375  0.44061589  3.545262384 -0.949516961     high
## 487  0.39439205  0.325853062 -0.373248611     high
## 180  0.44061589 -1.066096858  1.594762170      low
## 87   0.43064819  0.028978431 -0.003567028      low
## 202  0.40633138 -0.731412722  0.170400776      low
## 186  0.33338095  0.069588640  0.768415102      low
## 304  0.36974663 -1.091303195  1.148969673  med_low
## 316  0.43535821 -0.161469445 -0.688565255  med_low
## 260  0.38617691 -0.805631380  0.822780041 med_high
## 47   0.44061589  0.209623843 -0.275391721  med_low
## 161 -0.19446912 -1.001680665  0.485717421 med_high
## 339  0.43229122 -0.580174703 -0.210153795      low
## 413 -3.59148386  3.041135653 -0.503724464     high
## 155 -0.39053710  0.345457990 -0.601581353 med_high
## 457 -3.79204278  0.890194931 -1.069119826     high
## 168 -1.41370528 -0.071846915  0.137781813 med_high
## 331  0.13030271 -0.498954285 -0.297137697      low
## 113  0.41925653  0.498096362 -0.405867574  med_low
## 474  0.19722871 -0.139063813  0.790161078     high
## 377  0.06951068  1.482543841 -0.938643973     high
## 247  0.36700825 -0.489151821  0.192146752 med_high
## 466 -0.24397902  0.206823139 -0.286264709 med_high
## 141  0.34400586  1.611376228 -0.927770986 med_high
## 325  0.44061589 -0.914858839  0.268257666 med_high
## 169 -0.65265480 -0.217483527  0.137781813 med_high
## 246  0.35550706  0.813175569 -0.438486537  med_low
## 256  0.42177584 -0.476548653 -0.177534831      low
## 282  0.38946296 -1.129112700  1.399048391      low
## 499  0.44061589  0.037380543 -0.144915868  med_low
## 67   0.44061589 -0.337913801 -0.340629648      low
## 265  0.34192469 -0.637589136  1.518651256 med_high
## 471  0.44061589  0.509299178 -0.286264709     high
## 451 -3.90333053  0.670339662 -0.993008912     high
## 370  0.20434850 -1.249542974  2.986504601     high
##              zn       indus       chas         nox          rm         age
## 1    0.28454827 -1.28663623 -0.2723291 -0.14407485  0.41326292 -0.11989477
## 2   -0.48724019 -0.59279438 -0.2723291 -0.73953036  0.19408239  0.36680343
## 3   -0.48724019 -0.59279438 -0.2723291 -0.73953036  1.28144555 -0.26554897
## 6   -0.48724019 -1.30558569 -0.2723291 -0.83445805  0.20689164 -0.35080997
## 8    0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.16030692  0.97784057
## 12   0.04872402 -0.47618230 -0.2723291 -0.26489191 -0.39229670  0.50890509
## 15  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.26847393  0.56574575
## 16  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.64136549 -0.42896588
## 21  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -1.01710355  1.04889141
## 24  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.67125374  1.11638970
## 26  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.97582929  0.60837625
## 27  -0.48724019 -0.43682573 -0.2723291 -0.14407485 -0.67125374  0.77179316
## 29  -0.48724019 -0.43682573 -0.2723291 -0.14407485  0.29940290  0.91744737
## 36  -0.48724019 -0.75459363 -0.2723291 -0.48063666 -0.50046372 -0.01331852
## 49  -0.48724019 -0.61611679 -0.2723291 -0.92075595 -1.26047933  0.94942024
## 57   3.15731641 -1.51548743 -0.2723291 -1.24868797  0.13999888 -1.16789453
## 70   0.04872402 -0.73855947 -0.2723291 -1.25731776 -0.56877973 -1.26381315
## 90  -0.48724019 -1.12629463 -0.2723291 -0.56693456  1.13058103 -0.19449814
## 103 -0.48724019 -0.37560439 -0.2723291 -0.29941107  0.17131038  0.59771863
## 105 -0.48724019 -0.37560439 -0.2723291 -0.29941107 -0.16742317  0.76113554
## 109 -0.48724019 -0.37560439 -0.2723291 -0.29941107  0.26951465  1.01336599
## 112 -0.48724019 -0.16424500 -0.2723291 -0.06640675  0.61251795  0.46272205
## 114 -0.48724019 -0.16424500 -0.2723291 -0.06640675 -0.27416693  0.95297278
## 121 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.59012848  0.03996960
## 127 -0.48724019  2.11552109 -0.2723291  0.22700611 -0.95590379  0.96007787
## 129 -0.48724019  1.56744433 -0.2723291  0.59808708  0.20831489  1.07375920
## 143 -0.48724019  1.23072696  3.6647712  2.72964520 -1.25478633  1.11638970
## 144 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.16227507  1.11638970
## 146 -0.48724019  1.23072696 -0.2723291  2.72964520 -0.22008342  1.11638970
## 149 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.56363163  0.89613212
## 150 -0.48724019  1.23072696 -0.2723291  2.72964520 -0.97867579  0.93521008
## 152 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.25336308  1.11638970
## 157 -0.48724019  1.23072696 -0.2723291  2.72964520 -1.44123211  0.90323720
## 158 -0.48724019  1.23072696 -0.2723291  0.43412107  0.93701900  1.02402361
## 159 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.31117144  1.11638970
## 165 -0.48724019  1.23072696 -0.2723291  0.43412107 -0.61290048  0.82508129
## 170 -0.48724019  1.23072696 -0.2723291  0.43412107  0.16704063  0.94586770
## 179 -0.48724019 -1.03300497 -0.2723291 -0.38570897  0.81888923  0.20693906
## 185 -0.48724019 -1.26477147 -0.2723291 -0.57556435 -0.96871304  0.75403046
## 190  1.44223095 -1.12192167 -0.2723291 -1.01568364  1.28144555 -1.05421320
## 191  1.44223095 -1.12192167 -0.2723291 -1.01568364  0.94840500 -1.67235543
## 198  2.94293073 -1.40179066 -0.2723291 -1.30046671  1.17043203 -1.13592165
## 206 -0.48724019 -0.07970124 -0.2723291 -0.56693456 -0.56024023 -1.64393510
## 213 -0.48724019 -0.07970124  3.6647712 -0.56693456 -0.67979324 -0.52488450
## 216 -0.48724019 -0.07970124 -0.2723291 -0.56693456 -0.14607441 -0.92987424
## 217 -0.48724019  0.40132357  3.6647712 -0.04051738 -0.56450998 -0.44672859
## 223 -0.48724019 -0.71961001  3.6647712 -0.41159834  0.84593099  0.32417293
## 224 -0.48724019 -0.71961001 -0.2723291 -0.41159834  0.47446268  0.43430172
## 225 -0.48724019 -0.71961001 -0.2723291 -0.43748771  2.81997903  0.34548818
## 226 -0.48724019 -0.71961001 -0.2723291 -0.43748771  3.47325088  0.51245763
## 227 -0.48724019 -0.71961001 -0.2723291 -0.43748771  2.49832448  0.63679658
## 233 -0.48724019 -0.71961001 -0.2723291 -0.41159834  2.92102980  0.16786110
## 237 -0.48724019 -0.71961001  3.6647712 -0.41159834  0.49296493  0.28154243
## 243  0.79907391 -0.90473168 -0.2723291 -1.09335175  0.10441762 -0.55685738
## 245  0.45605682 -0.76917014 -0.2723291 -1.06746238 -0.98436879  0.28154243
## 251  0.45605682 -0.76917014 -0.2723291 -1.06746238  0.28801690 -1.97432146
## 257  3.37170210 -1.07673449 -0.2723291 -1.38676461  1.66429986 -1.22118265
## 263  0.37030254 -1.04466617 -0.2723291  0.79657225  3.00784806  0.81442366
## 274  0.37030254 -0.60882854  3.6647712 -0.78267931  2.00161016 -0.59593534
## 279  1.22784527 -0.68899934 -0.2723291 -0.92938574  0.28090065 -1.29578602
## 280  0.37030254 -1.13795583 -0.2723291 -0.96476788  0.75057322 -1.29223348
## 294 -0.48724019  0.40569652 -0.2723291 -1.01568364 -0.22435318 -1.78248422
## 295 -0.48724019  0.40569652 -0.2723291 -1.01568364 -0.39229670 -0.93342678
## 298 -0.48724019  0.40569652 -0.2723291 -1.01568364 -0.70398850 -0.37567776
## 308  0.92770532 -1.30558569 -0.2723291 -0.71364099  0.80323348  0.06128485
## 320 -0.48724019 -0.18027916 -0.2723291 -0.09229612 -0.24427868 -0.34725743
## 347 -0.48724019 -0.98344483 -0.2723291 -0.97253469 -0.55027747 -0.57817263
## 355  2.94293073 -1.34494227 -0.2723291 -1.22279860 -0.88474128 -1.65814526
## 358 -0.48724019  1.01499462  3.6647712  1.85803641  0.15707788  0.79666096
## 364 -0.48724019  1.01499462  3.6647712  1.85803641 -0.68548625  0.72561012
## 366 -0.48724019  1.01499462 -0.2723291  1.40928733 -3.87641323  0.68653217
## 367 -0.48724019  1.01499462 -0.2723291  1.40928733 -1.88101643  0.81087112
## 374 -0.48724019  1.01499462 -0.2723291  0.97779784 -1.96214169  1.11638970
## 376 -0.48724019  1.01499462 -0.2723291  1.00368721  1.46362158  1.04178632
## 382 -0.48724019  1.01499462 -0.2723291  1.00368721  0.37056541  1.08441682
## 385 -0.48724019  1.01499462 -0.2723291  1.25395112 -2.72785030  0.80376604
## 386 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.43411586  1.04889141
## 390 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.27328858  1.07731174
## 393 -0.48724019  1.01499462 -0.2723291  1.25395112 -1.77711916  1.00981345
## 394 -0.48724019  1.01499462 -0.2723291  1.19354259 -0.13041866  0.85350162
## 403 -0.48724019  1.01499462 -0.2723291  1.19354259  0.16988713  1.11638970
## 408 -0.48724019  1.01499462 -0.2723291  0.90012973 -0.96302004  1.11638970
## 414 -0.48724019  1.01499462 -0.2723291  0.36508275 -1.60775238  1.11638970
## 422 -0.48724019  1.01499462 -0.2723291  1.40928733 -0.39656645  0.94942024
## 441 -0.48724019  1.01499462 -0.2723291  1.59914271 -0.66413749  0.84639654
## 449 -0.48724019  1.01499462 -0.2723291  1.36613839 -0.14180466  1.07020666
## 450 -0.48724019  1.01499462 -0.2723291  1.36613839  0.18838939  1.05599649
## 458 -0.48724019  1.01499462 -0.2723291  1.36613839 -0.49619397  0.41653901
## 459 -0.48724019  1.01499462 -0.2723291  1.36613839  0.02329236  0.53732542
## 460 -0.48724019  1.01499462 -0.2723291  1.36613839 -0.28982269  0.56219321
## 461 -0.48724019  1.01499462 -0.2723291  1.36613839  0.59259245  0.76113554
## 463 -0.48724019  1.01499462 -0.2723291  1.36613839  0.04606437  0.51245763
## 468 -0.48724019  1.01499462 -0.2723291  0.25289548 -0.40083620  0.92099991
## 470 -0.48724019  1.01499462 -0.2723291  0.21837632 -0.81357876 -0.42186080
## 475 -0.48724019  1.01499462 -0.2723291  0.25289548 -1.22062833  0.95297278
## 476 -0.48724019  1.01499462 -0.2723291  0.25289548 -0.17453942  1.02402361
## 478 -0.48724019  1.01499462 -0.2723291  0.51178918 -1.39568810  1.02047107
## 483 -0.48724019  1.01499462 -0.2723291 -0.19585359  1.10496252  0.29930514
## 489 -0.48724019  2.42017014 -0.2723291  0.46864023 -1.18220057  0.85705416
## 490 -0.48724019  2.42017014 -0.2723291  0.46864023 -1.23913058  1.05599649
## 503 -0.48724019  0.11562398 -0.2723291  0.15796779 -0.23431593  0.28864751
## 505 -0.48724019  0.11562398 -0.2723291  0.15796779  0.72495472  0.73626775
##              dis        rad         tax     ptratio        black
## 1    0.140074984 -0.9818712 -0.66594918 -1.45755797  0.440615895
## 2    0.556609050 -0.8670245 -0.98635338 -0.30279450  0.440615895
## 3    0.556609050 -0.8670245 -0.98635338 -0.30279450  0.396035074
## 6    1.076671135 -0.7521778 -1.10502160  0.11292035  0.410165113
## 8    1.023624897 -0.5224844 -0.57694801 -1.50374851  0.440615895
## 12   1.154792049 -0.5224844 -0.57694801 -1.50374851  0.440615895
## 15   0.316689987 -0.6373311 -0.60068166  1.17530274  0.255720500
## 16   0.334118787 -0.6373311 -0.60068166  1.17530274  0.426595391
## 21   0.001356935 -0.6373311 -0.60068166  1.17530274  0.217930861
## 24   0.142544460 -0.6373311 -0.60068166  1.17530274  0.414765591
## 26   0.313223223 -0.6373311 -0.60068166  1.17530274 -0.583319029
## 27   0.421215295 -0.6373311 -0.60068166  1.17530274  0.221326452
## 29   0.313270713 -0.6373311 -0.60068166  1.17530274  0.342472368
## 36  -0.206458943 -0.5224844 -0.76681717  0.34387304  0.440615895
## 49   0.985395514 -0.7521778 -1.03975408 -0.25660396  0.440615895
## 57   2.560921014 -0.8670245 -0.56508119 -0.53374719  0.440615895
## 70   1.283632195 -0.6373311 -0.37521203  0.20530143  0.440615895
## 90  -0.180719408 -0.8670245 -0.82021787 -0.30279450  0.431414939
## 103 -0.513053850 -0.5224844 -0.14380900  1.12911220 -3.131326538
## 105 -0.652531738 -0.5224844 -0.14380900  1.12911220  0.394501581
## 109 -0.646880437 -0.5224844 -0.14380900  1.12911220  0.422433054
## 112 -0.530720099 -0.4076377  0.14099473 -0.30279450  0.426266786
## 114 -0.592219542 -0.4076377  0.14099473 -0.30279450  0.440615895
## 121 -0.730082773 -0.8670245 -1.30675758  0.29768250  0.355726125
## 127 -0.967769809 -0.8670245 -1.30675758  0.29768250  0.028654058
## 129 -0.941507885 -0.6373311  0.17066179  1.26768382  0.440615895
## 143 -1.174635890 -0.5224844 -0.03107419 -1.73470120  0.440615895
## 144 -1.131799984 -0.5224844 -0.03107419 -1.73470120  0.440615895
## 146 -1.128333220 -0.5224844 -0.03107419 -1.73470120 -2.012862748
## 149 -1.075856861 -0.5224844 -0.03107419 -1.73470120  0.003460966
## 150 -1.077708968 -0.5224844 -0.03107419 -1.73470120 -0.052840120
## 152 -1.046413113 -0.5224844 -0.03107419 -1.73470120 -0.165113687
## 157 -0.977647712 -0.5224844 -0.03107419 -1.73470120 -2.936025300
## 158 -0.910734419 -0.5224844 -0.03107419 -1.73470120  0.074001626
## 159 -0.967722319 -0.5224844 -0.03107419 -1.73470120 -0.030494942
## 165 -0.652056838 -0.5224844 -0.03107419 -1.73470120  0.421009097
## 170 -0.727803257 -0.5224844 -0.03107419 -1.73470120 -0.291736362
## 179 -0.417789076 -0.5224844 -0.66594918 -0.85708096  0.378947585
## 185 -0.383311396 -0.7521778 -1.27709053 -0.30279450  0.375990135
## 190  0.366459420 -0.5224844 -0.06074124 -1.50374851  0.440615895
## 191  1.274989030 -0.5224844 -0.06074124 -1.50374851  0.230089266
## 198  1.668775425 -0.8670245 -0.47014661 -2.70470251 -0.025894464
## 206  0.071404563 -0.6373311 -0.77868399  0.06672981  0.440615895
## 213 -0.067645915 -0.6373311 -0.77868399  0.06672981  0.375332924
## 216  0.071404563 -0.6373311 -0.77868399  0.06672981  0.404797889
## 217 -0.324328918 -0.5224844 -0.78461740 -0.94946204  0.395706469
## 223 -0.248345051 -0.1779443 -0.60068166 -0.48755665  0.369308489
## 224 -0.248345051 -0.1779443 -0.60068166 -0.48755665  0.440615895
## 225 -0.427714469 -0.1779443 -0.60068166 -0.48755665  0.310816699
## 226 -0.427714469 -0.1779443 -0.60068166 -0.48755665  0.277408467
## 227 -0.275129364 -0.1779443 -0.60068166 -0.48755665  0.336338397
## 233  0.020590352 -0.1779443 -0.60068166 -0.48755665  0.320236725
## 237  0.167619136 -0.1779443 -0.60068166 -0.48755665  0.348058662
## 243  1.538890501 -0.4076377 -0.64221553 -0.85708096  0.176088420
## 245  1.975512802 -0.2927910 -0.46421320  0.29768250  0.173240505
## 251  1.710424083 -0.2927910 -0.46421320  0.29768250  0.433824713
## 257  1.206746019 -0.7521778 -0.97448656 -1.18041474  0.324946738
## 263 -0.715455878 -0.5224844 -0.85581834 -2.51994036  0.330642568
## 274  0.271384606 -0.7521778 -1.09908819  0.06672981  0.373470826
## 279  0.163962412 -0.6373311 -0.91515245 -0.39517558  0.440615895
## 280  0.145156405 -0.5224844 -1.14062207 -1.64232012  0.440615895
## 294  0.810965047 -0.6373311 -0.70748306 -1.13422420  0.440615895
## 295  0.810965047 -0.6373311 -0.70748306 -1.13422420  0.440615895
## 298  1.199100142 -0.6373311 -0.70748306 -1.13422420  0.440615895
## 308 -0.290801037 -0.2927910 -1.10502160 -0.02565127  0.440615895
## 320  0.098236367 -0.6373311 -0.61848189 -0.02565127  0.433277038
## 347  2.003389383 -0.7521778 -0.33367816  0.15911089  0.086926778
## 355  3.224877549 -0.6373311 -0.44047956  1.63720813  0.286171282
## 358 -0.612545227  1.6596029  1.52941294  0.80577843  0.379714331
## 364 -0.897722181  1.6596029  1.52941294  0.80577843 -0.039805433
## 366 -1.036155290  1.6596029  1.52941294  0.80577843 -0.021622592
## 367 -0.970096815  1.6596029  1.52941294  0.80577843 -0.445195159
## 374 -1.244636028  1.6596029  1.52941294  0.80577843  0.440615895
## 376 -1.177152855  1.6596029  1.52941294  0.80577843  0.440615895
## 382 -1.080795813  1.6596029  1.52941294  0.80577843  0.440615895
## 385 -1.118645277  1.6596029  1.52941294  0.80577843 -0.775991422
## 386 -1.125008926  1.6596029  1.52941294  0.80577843  0.440615895
## 390 -0.981589375  1.6596029  1.52941294  0.80577843  0.440615895
## 393 -0.961691100  1.6596029  1.52941294  0.80577843  0.440615895
## 394 -0.951623237  1.6596029  1.52941294  0.80577843  0.440615895
## 403 -1.023902892  1.6596029  1.52941294  0.80577843  0.212892242
## 408 -1.191922219  1.6596029  1.52941294  0.80577843 -0.269281649
## 414 -1.047457891  1.6596029  1.52941294  0.80577843 -1.595971828
## 422 -0.912016646  1.6596029  1.52941294  0.80577843 -0.401928760
## 441 -0.916005799  1.6596029  1.52941294  0.80577843  0.380919218
## 449 -0.728230666  1.6596029  1.52941294  0.80577843  0.440615895
## 450 -0.764607943  1.6596029  1.52941294  0.80577843 -0.574665749
## 458 -0.482422853  1.6596029  1.52941294  0.80577843 -3.868498343
## 459 -0.480570747  1.6596029  1.52941294  0.80577843 -0.925178346
## 460 -0.511724132  1.6596029  1.52941294  0.80577843  0.440615895
## 461 -0.568712033  1.6596029  1.52941294  0.80577843 -1.111169093
## 463 -0.503698336  1.6596029  1.52941294  0.80577843  0.440615895
## 468 -0.595876266  1.6596029  1.52941294  0.80577843 -0.278044464
## 470 -0.461289840  1.6596029  1.52941294  0.80577843  0.440615895
## 475 -0.648352625  1.6596029  1.52941294  0.80577843 -0.044844052
## 476 -0.754635060  1.6596029  1.52941294  0.80577843 -0.590548351
## 478 -0.804641943  1.6596029  1.52941294  0.80577843 -0.078799960
## 483 -0.182571515  1.6596029  1.52941294  0.80577843  0.422871195
## 489 -0.937518732 -0.6373311  1.79641644  0.75958789  0.420790026
## 490 -0.968624628 -0.6373311  1.79641644  0.75958789 -0.138277566
## 503 -0.715930777 -0.9818712 -0.80241764  1.17530274  0.440615895
## 505 -0.667776001 -0.9818712 -0.80241764  1.17530274  0.402826256
##            lstat        medv    crime
## 1   -1.074498970  0.15952779      low
## 2   -0.491952525 -0.10142392      low
## 3   -1.207532413  1.32293748      low
## 6   -1.042290874  0.67055821      low
## 8    0.909799859  0.49659041  med_low
## 12   0.086392864 -0.39499459  med_low
## 15  -0.335113097 -0.47110550 med_high
## 16  -0.585776111 -0.28626471 med_high
## 21   1.171665689 -0.97126294 med_high
## 24   1.012025558 -0.87340605 med_high
## 26   0.540106923 -0.93864397 med_high
## 27   0.302047077 -0.64507330 med_high
## 29   0.020576319 -0.44935953 med_high
## 36  -0.416333515 -0.39499459      low
## 49   2.542610329 -0.88427903  med_low
## 57  -0.963871160  0.23563870      low
## 70  -0.540964846 -0.17753483  med_low
## 90  -0.973673624  0.67055821      low
## 103 -0.283300072 -0.42761355  med_low
## 105 -0.045240227 -0.26451873  med_low
## 109 -0.053642339 -0.29713770  med_low
## 112 -0.349116618  0.02905194  med_low
## 114  0.621327341 -0.41674056  med_low
## 121  0.240431588 -0.05793197      low
## 127  2.045485358 -0.74293019 med_high
## 129  0.383267495 -0.49285148 med_high
## 143  1.983869868 -0.99300891 med_high
## 144  1.927855787 -0.75380318     high
## 146  2.121104367 -0.94951696 med_high
## 149  2.193922673 -0.51459745 med_high
## 150  1.231880827 -0.77554916 med_high
## 152  0.087793216 -0.31888367 med_high
## 157  0.488293898 -1.02562788 med_high
## 158 -1.129112700  2.04055467 med_high
## 159 -0.871447926  0.19214675 med_high
## 165 -0.141864517  0.01817895 med_high
## 170 -0.186675782 -0.02531300 med_high
## 179 -0.802830676  0.80103407      low
## 185  0.185817859  0.42047949  med_low
## 190 -1.017084537  1.34468345  med_low
## 191 -1.057694746  1.57301619  med_low
## 198 -0.566171183  0.84452602      low
## 206 -0.249691623  0.00730596  med_low
## 213  0.472890025 -0.01444002  med_low
## 216 -0.445740908  0.26825767  med_low
## 217  0.120001313  0.08341687      low
## 223 -0.381324714  0.54008236 med_high
## 224 -0.707606738  0.82278004 med_high
## 225 -1.192128541  2.42110924 med_high
## 226 -1.123511291  2.98650460 med_high
## 227 -1.333564096  1.63825412 med_high
## 233 -1.425987330  2.08404662 med_high
## 237 -0.435938444  0.27913065 med_high
## 243 -0.200679302 -0.03618599  med_low
## 245 -0.021434242 -0.53634343  med_low
## 251 -0.945666583  0.20301974  med_low
## 257 -1.336364800  2.33412534      low
## 263 -0.944266231  2.85602875 med_high
## 274 -0.850442645  1.37730242  med_low
## 279 -0.765021171  0.71405016      low
## 280 -1.092703547  1.36642943  med_low
## 294 -0.570372239  0.14865480  med_low
## 295 -0.315508169 -0.09055093      low
## 298  0.446283337 -0.24277276  med_low
## 308 -0.717409202  0.61619327      low
## 320  0.010773855 -0.16666184 med_high
## 347  0.002371742 -0.57983538      low
## 355 -0.644590896 -0.47110550      low
## 358  0.086392864 -0.09055093     high
## 364  0.278241093 -0.62332733     high
## 366 -0.774823635  0.54008236     high
## 367  0.188618563 -0.06880495     high
## 374  3.097149734 -0.94951696     high
## 376  0.110198849 -0.81904111     high
## 382  1.180067802 -1.26483361     high
## 385  2.517403992 -1.49316635     high
## 386  2.542610329 -1.66713415     high
## 390  1.147859705 -1.19959568     high
## 393  1.824229736 -1.39530946     high
## 394  0.352459751 -0.94951696     high
## 403  1.072240695 -1.13435775     high
## 408 -0.073247267  0.58357431     high
## 414  1.040032598 -0.67769227     high
## 422  0.426678408 -0.90602501     high
## 441  1.324304061 -1.30832556     high
## 449  0.766963952 -0.91689800     high
## 450  0.932205492 -1.03650086     high
## 458  0.600322060 -0.98213592     high
## 459  0.500897066 -0.82991410     high
## 460  0.286643205 -0.27539172     high
## 461  0.527503755 -0.66681928     high
## 463  0.187218211 -0.32975666     high
## 468  1.213676250 -0.37324861     high
## 470  0.295045317 -0.26451873     high
## 475  0.768364304 -0.94951696     high
## 476  1.602974115 -1.00388190     high
## 478  1.716402630 -1.14523074     high
## 483 -0.790227508  0.26825767     high
## 489  0.757161488 -0.79729513  med_low
## 490  1.584769539 -1.68888013  med_low
## 503 -0.500354637 -0.21015379      low
## 505 -0.864446166 -0.05793197  med_low

4.5 Fit the linear discriminant analysis on the train set. Use the categorical crime rate (“crime”) as the target variable and all the other variables in the dataset as predictor variables. Draw the LDA (bi)plot.

## Call:
## lda(crime ~ ., data = train)
## 
## Prior probabilities of groups:
##       low   med_low  med_high      high 
## 0.2698020 0.2500000 0.2425743 0.2376238 
## 
## Group means:
##                  zn      indus        chas        nox          rm
## low       1.0360783 -0.9525935 -0.12784833 -0.9101627  0.47716555
## med_low  -0.1026195 -0.3043382 -0.03844192 -0.5672763 -0.14372112
## med_high -0.3629840  0.1702413  0.20976484  0.3375203  0.07769538
## high     -0.4872402  1.0149946 -0.06727176  1.0339814 -0.32128245
##                 age        dis        rad        tax     ptratio
## low      -0.9543183  0.9208545 -0.6826376 -0.7279506 -0.45746924
## med_low  -0.3859133  0.3602058 -0.5418150 -0.5071570 -0.02976726
## med_high  0.3282692 -0.3629358 -0.3912310 -0.2804591 -0.22643871
## high      0.8039141 -0.8591920  1.6596029  1.5294129  0.80577843
##               black       lstat        medv
## low       0.3810478 -0.79265564  0.55275089
## med_low   0.3457725 -0.15570166 -0.01304052
## med_high  0.1082593 -0.01218906  0.16618472
## high     -0.9939756  0.89668615 -0.68041051
## 
## Coefficients of linear discriminants:
##                 LD1          LD2         LD3
## zn       0.10272977  0.729572657 -0.83061170
## indus   -0.02218105 -0.352054987  0.43359857
## chas    -0.06459343 -0.073375319  0.05199302
## nox      0.30888169 -0.715477057 -1.50495131
## rm      -0.08673897  0.008977995 -0.16461288
## age      0.28801291 -0.181157713 -0.06933376
## dis     -0.11680771 -0.231461583  0.17555279
## rad      3.08390782  0.975745080  0.44279663
## tax      0.08059777 -0.005138075  0.05719437
## ptratio  0.13362982  0.089543556 -0.28370428
## black   -0.19799490 -0.037052465  0.16891607
## lstat    0.18594269 -0.233128273  0.28071101
## medv     0.17836518 -0.313724797 -0.30446991
## 
## Proportion of trace:
##    LD1    LD2    LD3 
## 0.9471 0.0400 0.0129

  • According to the linear description fit you can see how most of the high crime category correlates with the rad (index of accessibility to radial highways).

4.6 Save the crime categories from the test set and then remove the categorical crime variable from the test dataset. Then predict the classes with the LDA model on the test data. Cross tabulate the results with the crime categories from the test set.

##   [1] low      low      low      low      med_low  med_low  med_high
##   [8] med_high med_high med_high med_high med_high med_high low     
##  [15] med_low  low      med_low  low      med_low  med_low  med_low 
##  [22] med_low  med_low  low      med_high med_high med_high high    
##  [29] med_high med_high med_high med_high med_high med_high med_high
##  [36] med_high med_high low      med_low  med_low  med_low  low     
##  [43] med_low  med_low  med_low  low      med_high med_high med_high
##  [50] med_high med_high med_high med_high med_low  med_low  med_low 
##  [57] low      med_high med_low  low      med_low  med_low  low     
##  [64] med_low  low      med_high low      low      high     high    
##  [71] high     high     high     high     high     high     high    
##  [78] high     high     high     high     high     high     high    
##  [85] high     high     high     high     high     high     high    
##  [92] high     high     high     high     high     high     high    
##  [99] med_low  med_low  low      med_low 
## Levels: low med_low med_high high
##           predicted
## correct    low med_low med_high high
##   low        8      10        0    0
##   med_low    5      13        7    0
##   med_high   0       8       20    0
##   high       0       0        1   30
  • You can see how the predicted and corrected data tend to agree on the most extreme values (“low” and “high”), in the “med-low” and “med-high” you can see the most discrepance between the correct data and the predicted one.

4.7 Reload the Boston dataset and standardize the dataset (we did not do this in the Datacamp exercises, but you should scale the variables to get comparable distances). Calculate the distances between the observations.

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.1343  3.4625  4.8241  4.9111  6.1863 14.3970
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.2662  8.4832 12.6090 13.5488 17.7568 48.8618
  • You can see how the two methods to calculate the distances between the variables , gives you as result different numbers, but you can also note how the trend between the variations is maintained.

4.7.1 Run k-means algorithm on the dataset. Investigate what is the optimal number of clusters and run the algorithm again. Visualize the clusters (for example with the pairs() or ggpairs() functions, where the clusters are separated with colors):

  • While checking for the optimal number of clusters you should look in the graph when defining the k max = 10 for the k value where the curve varies the most dramatically. That appears to be around k = 2

  • When exploring the pairs using the colors to separate the km clusters, you can see that the variable that better separetes the two clusters (Red Vs Black cluster) would be tax (full-value property-tax rate per $10,000) and rad (index of accessibility to radial highways). An almost complete cluster separation can also be observed when you check the crim (per capita crime rate by town) and black (1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town) variables.

4.8 Optional / Bonus sections:

4.8.1 Perform k-means on the original Boston data with some reasonable number of clusters (> 2). Remember to standardize the dataset.

  • For the reasonable amount of clusters (> 2) I select k = 3 as it was the following position in the curve you could observe a dramatically change.

  • Now when you check at the pairs with the clusters divided by colors, since we have more clusters it gets a bit more confusing to read the data. Nonetheless, after careful observation you the variables were you can more easily identify the different clusters (Red, Black and Green) are medv (median value of owner-occupied homes in $1000s) and partialy successful will be age (proportion of owner-occupied units built prior to 1940).

4.8.2 Then perform LDA using the clusters as target classes. Include all the variables in the Boston data in the LDA model. Visualize the results with a biplot (include arrows representing the relationships of the original variables to the LDA solution).

I was trying the following approach but I guess I missed something, further work/learning required in this section ; if the peer review knows how to fix this and explain me what is wrong I highly appreciate it!!

  • k-means clustering km <-kmeans(boston_scaled, centers = 3)

  • linear discriminant analysis lda.fit <- lda(km ~ . , data = boston_scaled$km)

  • print the lda.fit object lda.fit

  • function for the lda biplot arrows lda.arrows <- function(x, myscale = 2, arrow_heads = 0.1, color = “red”, tex = 0.75, choices = c(1,2)){ heads <- coef(x) arrows(x0 = 0, y0 = 0, x1 = myscale * heads[,choices[1]], y1 = myscale * heads[,choices[2]], col=color, length = arrow_heads) text(myscale * heads[,choices], labels = row.names(heads), cex = tex, col=color, pos=3) }

  • target classes as numeric classes <- as.numeric(boston_scaled$km)

  • plot the lda results plot(lda.fit, dimen = 2, col = classes, pch = classes) lda.arrows(lda.fit, myscale = 5)

  • I got stuck in this section as unfortunetely I couldn’t manage to fix the errors in my code

4.9 Super-Bonus: Run the provided code for the (scaled) train data that you used to fit the LDA. The code creates a matrix product, which is a projection of the data points.

## [1] 404  13
## [1] 13  3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:MASS':
## 
##     select
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## Warning: 'scatter3d' objects don't have these attributes: 'col'
## Valid attributes include:
## 'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'hoverinfo', 'hoverlabel', 'stream', 'x', 'y', 'z', 'text', 'hovertext', 'mode', 'surfaceaxis', 'surfacecolor', 'projection', 'connectgaps', 'line', 'marker', 'textposition', 'textfont', 'error_x', 'error_y', 'error_z', 'scene', 'xcalendar', 'ycalendar', 'zcalendar', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'zsrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule'

4.9.1 Draw another 3D plot where the color is defined by the clusters of the k-means. How do the plots differ?

  • If I performed this correcly it seems that they don’t differ much. Maybe the clusters don’t separate that well the the data in the extreme negative x values (-2 < x < -4 ).